home *** CD-ROM | disk | FTP | other *** search
MacBinary | 2000-02-25 | 15.8 KB | [TEXT/CWIE] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Fri Feb 25 05:00:00 2000, modified Fri Feb 25 05:00:00 2000, creator 'CWIE', type ASCII, 15516 bytes "WEScraps.c" , at 0x3d1c 286 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [CWIE] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 57 45 53 63 72 61 | 70 73 2e 63 00 00 00 00 |..WEScra|ps.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 3c 9c 00 | 00 01 1e b4 dc 03 20 b4 |.....<..|...... .|
|00000060| dc 03 20 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.. .....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 ce 0b 00 00 |........|........|
|00000080| 2f 2a 0d 20 2a 09 57 45 | 53 63 72 61 70 73 2e 63 |/*. *.WE|Scraps.c|
|00000090| 0d 20 2a 0d 20 2a 09 57 | 41 53 54 45 20 50 52 4f |. *. *.W|ASTE PRO|
|000000a0| 4a 45 43 54 0d 20 2a 20 | 20 52 6f 75 74 69 6e 65 |JECT. * | Routine|
|000000b0| 73 20 66 6f 72 20 4d 61 | 6e 69 70 75 6c 61 74 69 |s for Ma|nipulati|
|000000c0| 6e 67 20 53 74 79 6c 65 | 20 53 63 72 61 70 73 20 |ng Style| Scraps |
|000000d0| 61 6e 64 20 4f 62 6a 65 | 63 74 20 53 6f 75 70 73 |and Obje|ct Soups|
|000000e0| 0d 20 2a 0d 20 2a 20 20 | 43 6f 70 79 72 69 67 68 |. *. * |Copyrigh|
|000000f0| 74 20 28 63 29 20 31 39 | 39 33 2d 31 39 39 38 20 |t (c) 19|93-1998 |
|00000100| 4d 61 72 63 6f 20 50 69 | 6f 76 61 6e 65 6c 6c 69 |Marco Pi|ovanelli|
|00000110| 0d 20 2a 09 41 6c 6c 20 | 52 69 67 68 74 73 20 52 |. *.All |Rights R|
|00000120| 65 73 65 72 76 65 64 0d | 20 2a 0d 20 2a 20 20 43 |eserved.| *. * C|
|00000130| 20 70 6f 72 74 20 62 79 | 20 44 61 6e 20 43 72 65 | port by| Dan Cre|
|00000140| 76 69 65 72 0d 20 2a 0d | 20 2a 2f 0d 0d 2f 2a 0d |vier. *.| */../*.|
|00000150| 09 50 6f 72 74 69 6f 6e | 73 20 63 6f 70 79 72 69 |.Portion|s copyri|
|00000160| 67 68 74 20 a9 20 31 39 | 39 38 2d 32 30 30 30 20 |ght . 19|98-2000 |
|00000170| 62 79 20 41 70 70 6c 65 | 20 43 6f 6d 70 75 74 65 |by Apple| Compute|
|00000180| 72 2c 20 49 6e 63 2e 20 | 41 6c 6c 20 72 69 67 68 |r, Inc. |All righ|
|00000190| 74 73 20 72 65 73 65 72 | 76 65 64 2e 0d 0d 09 43 |ts reser|ved....C|
|000001a0| 68 61 6e 67 65 20 48 69 | 73 74 6f 72 79 3a 0d 09 |hange Hi|story:..|
|000001b0| 09 30 31 2f 30 37 2f 30 | 30 09 54 57 42 09 09 43 |.01/07/0|0.TWB..C|
|000001c0| 61 72 62 6f 6e 3a 20 6e | 65 77 20 73 63 72 61 70 |arbon: n|ew scrap|
|000001d0| 20 41 50 49 73 2e 20 0d | 09 09 31 31 2f 31 37 2f | APIs. .|..11/17/|
|000001e0| 39 39 09 54 57 42 09 09 | 53 74 72 65 61 6d 69 6e |99.TWB..|Streamin|
|000001f0| 67 20 73 75 70 70 6f 72 | 74 20 66 6f 72 20 73 74 |g suppor|t for st|
|00000200| 79 6c 65 72 73 2e 20 0d | 09 09 31 31 2f 31 30 2f |ylers. .|..11/10/|
|00000210| 39 39 09 54 57 42 09 09 | 43 6c 65 61 6e 20 75 70 |99.TWB..|Clean up|
|00000220| 20 74 68 65 20 70 72 69 | 76 61 74 65 20 69 6e 74 | the pri|vate int|
|00000230| 65 72 66 61 63 65 73 2e | 20 0d 09 09 31 30 2f 32 |erfaces.| ...10/2|
|00000240| 39 2f 39 38 09 54 57 42 | 09 09 5a 6f 6f 6d 20 73 |9/98.TWB|..Zoom s|
|00000250| 75 70 70 6f 72 74 2e 20 | 0d 2a 2f 0d 0d 0d 23 69 |upport. |.*/...#i|
|00000260| 6e 63 6c 75 64 65 20 22 | 57 41 53 54 45 49 6e 74 |nclude "|WASTEInt|
|00000270| 66 2e 68 22 0d 0d 70 61 | 73 63 61 6c 20 4f 53 45 |f.h"..pa|scal OSE|
|00000280| 72 72 20 5f 57 45 50 72 | 65 70 65 6e 64 53 74 79 |rr _WEPr|ependSty|
|00000290| 6c 65 28 53 74 53 63 72 | 70 48 61 6e 64 6c 65 20 |le(StScr|pHandle |
|000002a0| 68 53 74 79 6c 65 53 63 | 72 61 70 2c 20 63 6f 6e |hStyleSc|rap, con|
|000002b0| 73 74 20 57 45 52 75 6e | 49 6e 66 6f 50 72 69 76 |st WERun|InfoPriv|
|000002c0| 20 2a 69 6e 66 6f 2c 20 | 53 49 6e 74 33 32 20 6f | *info, |SInt32 o|
|000002d0| 66 66 73 65 74 44 65 6c | 74 61 29 0d 7b 0d 09 2f |ffsetDel|ta).{../|
|000002e0| 2f 20 63 6f 6d 70 61 72 | 65 20 74 68 65 20 73 74 |/ compar|e the st|
|000002f0| 79 6c 69 73 74 69 63 20 | 61 74 74 72 69 62 75 74 |ylistic |attribut|
|00000300| 65 73 20 69 6e 20 69 6e | 66 6f 20 77 69 74 68 20 |es in in|fo with |
|00000310| 74 68 65 20 66 69 72 73 | 74 20 65 6c 65 6d 65 6e |the firs|t elemen|
|00000320| 74 20 6f 66 20 74 68 65 | 20 73 70 65 63 69 66 69 |t of the| specifi|
|00000330| 65 64 0d 09 2f 2f 20 73 | 74 79 6c 65 20 73 63 72 |ed..// s|tyle scr|
|00000340| 61 70 3a 20 69 66 20 74 | 68 65 79 20 64 69 66 66 |ap: if t|hey diff|
|00000350| 65 72 2c 20 70 72 65 70 | 65 6e 64 20 61 20 6e 65 |er, prep|end a ne|
|00000360| 77 20 65 6c 65 6d 65 6e | 74 20 74 6f 20 74 68 65 |w elemen|t to the|
|00000370| 20 73 74 79 6c 65 20 73 | 63 72 61 70 2e 0d 09 2f | style s|crap.../|
|00000380| 2f 20 69 6e 20 61 6e 79 | 20 63 61 73 65 2c 20 61 |/ in any| case, a|
|00000390| 64 76 61 6e 63 65 20 61 | 6c 6c 20 63 68 61 72 61 |dvance a|ll chara|
|000003a0| 63 74 65 72 20 6f 66 66 | 73 65 74 73 20 69 6e 20 |cter off|sets in |
|000003b0| 74 68 65 20 73 74 79 6c | 65 20 73 63 72 61 70 20 |the styl|e scrap |
|000003c0| 62 79 20 6f 66 66 73 65 | 74 44 65 6c 74 61 0d 0d |by offse|tDelta..|
|000003d0| 09 54 45 53 74 79 6c 65 | 53 63 72 61 70 20 2a 70 |.TEStyle|Scrap *p|
|000003e0| 53 63 72 61 70 3b 0d 09 | 54 45 53 74 79 6c 65 53 |Scrap;..|TEStyleS|
|000003f0| 63 72 61 70 45 6c 65 6d | 65 6e 74 20 65 6e 74 72 |crapElem|ent entr|
|00000400| 79 3b 0d 09 53 49 6e 74 | 31 36 20 69 3b 0d 09 4f |y;..SInt|16 i;..O|
|00000410| 53 45 72 72 20 65 72 72 | 3b 0d 0d 09 70 53 63 72 |SErr err|;...pScr|
|00000420| 61 70 20 3d 20 2a 20 28 | 54 45 53 74 79 6c 65 53 |ap = * (|TEStyleS|
|00000430| 63 72 61 70 48 61 6e 64 | 6c 65 29 20 68 53 74 79 |crapHand|le) hSty|
|00000440| 6c 65 53 63 72 61 70 3b | 0d 0d 09 2f 2f 20 63 6f |leScrap;|...// co|
|00000450| 6d 70 61 72 65 20 74 68 | 69 73 20 73 74 79 6c 65 |mpare th|is style|
|00000460| 20 69 6e 66 6f 20 77 69 | 74 68 20 74 68 61 74 20 | info wi|th that |
|00000470| 73 74 6f 72 65 64 20 69 | 6e 20 74 68 65 20 66 69 |stored i|n the fi|
|00000480| 72 73 74 20 65 6e 74 72 | 79 20 6f 66 20 6f 75 72 |rst entr|y of our|
|00000490| 20 70 72 69 76 61 74 65 | 20 73 74 79 6c 65 20 73 | private| style s|
|000004a0| 63 72 61 70 0d 09 69 66 | 20 28 21 5f 57 45 42 6c |crap..if| (!_WEBl|
|000004b0| 6f 63 6b 43 6d 70 28 26 | 70 53 63 72 61 70 2d 3e |ockCmp(&|pScrap->|
|000004c0| 73 63 72 70 53 74 79 6c | 65 54 61 62 5b 30 5d 2e |scrpStyl|eTab[0].|
|000004d0| 73 63 72 70 54 45 41 74 | 74 72 73 2c 20 26 69 6e |scrpTEAt|trs, &in|
|000004e0| 66 6f 2d 3e 72 75 6e 41 | 74 74 72 73 2c 20 73 69 |fo->runA|ttrs, si|
|000004f0| 7a 65 6f 66 28 54 45 52 | 75 6e 41 74 74 72 69 62 |zeof(TER|unAttrib|
|00000500| 75 74 65 73 29 29 29 0d | 09 7b 0d 09 09 2f 2f 20 |utes))).|.{...// |
|00000510| 69 6e 73 65 72 74 20 61 | 20 6e 65 77 20 73 74 79 |insert a| new sty|
|00000520| 6c 65 20 73 63 72 61 70 | 20 65 6e 74 72 79 20 61 |le scrap| entry a|
|00000530| 74 20 74 68 65 20 62 65 | 67 69 6e 6e 69 6e 67 20 |t the be|ginning |
|00000540| 6f 66 20 74 68 65 20 73 | 74 79 6c 65 20 73 63 72 |of the s|tyle scr|
|00000550| 61 70 0d 09 09 65 6e 74 | 72 79 2e 73 63 72 70 53 |ap...ent|ry.scrpS|
|00000560| 74 61 72 74 43 68 61 72 | 20 3d 20 30 3b 0d 09 09 |tartChar| = 0;...|
|00000570| 65 6e 74 72 79 2e 73 63 | 72 70 54 45 41 74 74 72 |entry.sc|rpTEAttr|
|00000580| 73 20 3d 20 2a 20 28 54 | 45 52 75 6e 41 74 74 72 |s = * (T|ERunAttr|
|00000590| 69 62 75 74 65 73 20 2a | 29 20 26 69 6e 66 6f 2d |ibutes *|) &info-|
|000005a0| 3e 72 75 6e 41 74 74 72 | 73 3b 0d 0d 09 09 69 66 |>runAttr|s;....if|
|000005b0| 20 28 28 65 72 72 20 3d | 20 5f 57 45 53 70 6c 69 | ((err =| _WESpli|
|000005c0| 63 65 28 28 48 61 6e 64 | 6c 65 29 68 53 74 79 6c |ce((Hand|le)hStyl|
|000005d0| 65 53 63 72 61 70 2c 20 | 26 65 6e 74 72 79 2c 20 |eScrap, |&entry, |
|000005e0| 73 69 7a 65 6f 66 28 65 | 6e 74 72 79 29 2c 20 73 |sizeof(e|ntry), s|
|000005f0| 69 7a 65 6f 66 28 53 49 | 6e 74 31 36 29 29 29 20 |izeof(SI|nt16))) |
|00000600| 21 3d 20 6e 6f 45 72 72 | 29 0d 09 09 7b 0d 09 09 |!= noErr|)...{...|
|00000610| 09 72 65 74 75 72 6e 20 | 65 72 72 3b 0d 09 09 7d |.return |err;...}|
|00000620| 0d 0d 09 09 70 53 63 72 | 61 70 20 3d 20 2a 20 28 |....pScr|ap = * (|
|00000630| 54 45 53 74 79 6c 65 53 | 63 72 61 70 48 61 6e 64 |TEStyleS|crapHand|
|00000640| 6c 65 29 20 68 53 74 79 | 6c 65 53 63 72 61 70 3b |le) hSty|leScrap;|
|00000650| 0d 0d 09 09 2f 2f 20 69 | 6e 63 72 65 6d 65 6e 74 |....// i|ncrement|
|00000660| 20 65 6e 74 72 79 20 63 | 6f 75 6e 74 0d 09 09 70 | entry c|ount...p|
|00000670| 53 63 72 61 70 2d 3e 73 | 63 72 70 4e 53 74 79 6c |Scrap->s|crpNStyl|
|00000680| 65 73 2b 2b 3b 0d 0d 09 | 7d 20 2f 2f 20 69 66 20 |es++;...|} // if |
|00000690| 6e 6f 74 20 5f 57 45 42 | 6c 6f 63 6b 43 6d 70 0d |not _WEB|lockCmp.|
|000006a0| 0d 09 2f 2f 20 75 70 64 | 61 74 65 20 63 68 61 72 |..// upd|ate char|
|000006b0| 20 6f 66 66 73 65 74 73 | 20 77 69 74 68 69 6e 20 | offsets| within |
|000006c0| 74 68 65 20 73 74 79 6c | 65 20 73 63 72 61 70 0d |the styl|e scrap.|
|000006d0| 09 66 6f 72 20 28 20 69 | 20 3d 20 70 53 63 72 61 |.for ( i| = pScra|
|000006e0| 70 2d 3e 73 63 72 70 4e | 53 74 79 6c 65 73 20 2d |p->scrpN|Styles -|
|000006f0| 20 31 3b 20 69 20 3e 20 | 30 3b 20 69 2d 2d 20 29 | 1; i > |0; i-- )|
|00000700| 0d 09 7b 0d 09 09 70 53 | 63 72 61 70 2d 3e 73 63 |..{...pS|crap->sc|
|00000710| 72 70 53 74 79 6c 65 54 | 61 62 5b 69 5d 2e 73 63 |rpStyleT|ab[i].sc|
|00000720| 72 70 53 74 61 72 74 43 | 68 61 72 20 2b 3d 20 6f |rpStartC|har += o|
|00000730| 66 66 73 65 74 44 65 6c | 74 61 3b 0d 09 7d 0d 0d |ffsetDel|ta;..}..|
|00000740| 09 72 65 74 75 72 6e 20 | 6e 6f 45 72 72 3b 0d 7d |.return |noErr;.}|
|00000750| 0d 0d 70 61 73 63 61 6c | 20 4f 53 45 72 72 20 5f |..pascal| OSErr _|
|00000760| 57 45 41 70 70 65 6e 64 | 53 74 79 6c 65 28 53 74 |WEAppend|Style(St|
|00000770| 53 63 72 70 48 61 6e 64 | 6c 65 20 68 53 74 79 6c |ScrpHand|le hStyl|
|00000780| 65 53 63 72 61 70 2c 20 | 63 6f 6e 73 74 20 57 45 |eScrap, |const WE|
|00000790| 52 75 6e 49 6e 66 6f 50 | 72 69 76 20 2a 69 6e 66 |RunInfoP|riv *inf|
|000007a0| 6f 2c 20 53 49 6e 74 33 | 32 20 6f 66 66 73 65 74 |o, SInt3|2 offset|
|000007b0| 29 0d 7b 0d 0d 09 2f 2f | 20 63 6f 6d 70 61 72 65 |).{...//| compare|
|000007c0| 20 74 68 65 20 73 74 79 | 6c 69 73 74 69 63 20 61 | the sty|listic a|
|000007d0| 74 74 72 69 62 75 74 65 | 73 20 69 6e 20 69 6e 66 |ttribute|s in inf|
|000007e0| 6f 20 77 69 74 68 20 74 | 68 65 20 6c 61 73 74 20 |o with t|he last |
|000007f0| 65 6e 74 72 79 20 6f 66 | 20 74 68 65 20 73 70 65 |entry of| the spe|
|00000800| 63 69 66 69 65 64 0d 09 | 2f 2f 20 73 74 79 6c 65 |cified..|// style|
|00000810| 20 73 63 72 61 70 3a 20 | 69 66 20 74 68 65 79 20 | scrap: |if they |
|00000820| 64 69 66 66 65 72 2c 20 | 61 70 70 65 6e 64 20 61 |differ, |append a|
|00000830| 20 6e 65 77 20 65 6e 74 | 72 79 20 74 6f 20 74 68 | new ent|ry to th|
|00000840| 65 20 73 74 79 6c 65 20 | 73 63 72 61 70 2e 0d 0d |e style |scrap...|
|00000850| 09 54 45 53 74 79 6c 65 | 53 63 72 61 70 20 2a 70 |.TEStyle|Scrap *p|
|00000860| 53 63 72 61 70 3b 0d 09 | 54 45 53 74 79 6c 65 53 |Scrap;..|TEStyleS|
|00000870| 63 72 61 70 45 6c 65 6d | 65 6e 74 20 65 6e 74 72 |crapElem|ent entr|
|00000880| 79 3b 0d 09 4f 53 45 72 | 72 20 65 72 72 3b 0d 0d |y;..OSEr|r err;..|
|00000890| 09 70 53 63 72 61 70 20 | 3d 20 2a 20 28 54 45 53 |.pScrap |= * (TES|
|000008a0| 74 79 6c 65 53 63 72 61 | 70 48 61 6e 64 6c 65 29 |tyleScra|pHandle)|
|000008b0| 20 68 53 74 79 6c 65 53 | 63 72 61 70 3b 0d 09 2f | hStyleS|crap;../|
|000008c0| 2f 20 63 6f 6d 70 61 72 | 65 20 74 68 69 73 20 73 |/ compar|e this s|
|000008d0| 74 79 6c 65 20 69 6e 66 | 6f 20 77 69 74 68 20 74 |tyle inf|o with t|
|000008e0| 68 61 74 20 73 74 6f 72 | 65 64 20 69 6e 20 74 68 |hat stor|ed in th|
|000008f0| 65 20 66 69 72 73 74 20 | 65 6e 74 72 79 20 6f 66 |e first |entry of|
|00000900| 20 6f 75 72 20 70 72 69 | 76 61 74 65 20 73 74 79 | our pri|vate sty|
|00000910| 6c 65 20 73 63 72 61 70 | 0d 09 69 66 20 28 21 5f |le scrap|..if (!_|
|00000920| 57 45 42 6c 6f 63 6b 43 | 6d 70 28 26 70 53 63 72 |WEBlockC|mp(&pScr|
|00000930| 61 70 2d 3e 73 63 72 70 | 53 74 79 6c 65 54 61 62 |ap->scrp|StyleTab|
|00000940| 5b 70 53 63 72 61 70 2d | 3e 73 63 72 70 4e 53 74 |[pScrap-|>scrpNSt|
|00000950| 79 6c 65 73 20 2d 20 31 | 5d 2e 73 63 72 70 54 45 |yles - 1|].scrpTE|
|00000960| 41 74 74 72 73 2c 0d 09 | 09 26 69 6e 66 6f 2d 3e |Attrs,..|.&info->|
|00000970| 72 75 6e 41 74 74 72 73 | 2c 20 73 69 7a 65 6f 66 |runAttrs|, sizeof|
|00000980| 28 54 45 52 75 6e 41 74 | 74 72 69 62 75 74 65 73 |(TERunAt|tributes|
|00000990| 29 29 29 0d 09 7b 0d 0d | 09 09 2f 2f 20 63 72 65 |)))..{..|..// cre|
|000009a0| 61 74 65 20 61 20 6e 65 | 77 20 73 74 79 6c 65 20 |ate a ne|w style |
|000009b0| 73 63 72 61 70 20 65 6e | 74 72 79 0d 09 09 65 6e |scrap en|try...en|
|000009c0| 74 72 79 2e 73 63 72 70 | 53 74 61 72 74 43 68 61 |try.scrp|StartCha|
|000009d0| 72 20 3d 20 6f 66 66 73 | 65 74 3b 0d 09 09 65 6e |r = offs|et;...en|
|000009e0| 74 72 79 2e 73 63 72 70 | 54 45 41 74 74 72 73 20 |try.scrp|TEAttrs |
|000009f0| 3d 20 2a 20 28 54 45 52 | 75 6e 41 74 74 72 69 62 |= * (TER|unAttrib|
|00000a00| 75 74 65 73 20 2a 29 20 | 26 69 6e 66 6f 2d 3e 72 |utes *) |&info->r|
|00000a10| 75 6e 41 74 74 72 73 3b | 0d 0d 09 09 2f 2f 20 61 |unAttrs;|....// a|
|00000a20| 70 70 65 6e 64 20 69 74 | 20 61 74 20 74 68 65 20 |ppend it| at the |
|00000a30| 65 6e 64 20 6f 66 20 74 | 68 65 20 73 74 79 6c 65 |end of t|he style|
|00000a40| 20 73 63 72 61 70 0d 09 | 09 69 66 20 28 28 65 72 | scrap..|.if ((er|
|00000a50| 72 20 3d 20 5f 57 45 53 | 70 6c 69 63 65 28 28 48 |r = _WES|plice((H|
|00000a60| 61 6e 64 6c 65 29 68 53 | 74 79 6c 65 53 63 72 61 |andle)hS|tyleScra|
|00000a70| 70 2c 20 26 65 6e 74 72 | 79 2c 20 73 69 7a 65 6f |p, &entr|y, sizeo|
|00000a80| 66 28 65 6e 74 72 79 29 | 2c 20 2d 31 29 29 20 21 |f(entry)|, -1)) !|
|00000a90| 3d 20 6e 6f 45 72 72 29 | 0d 09 09 7b 0d 09 09 09 |= noErr)|...{....|
|00000aa0| 72 65 74 75 72 6e 20 65 | 72 72 3b 0d 09 09 7d 0d |return e|rr;...}.|
|00000ab0| 0d 09 09 2f 2f 20 69 6e | 63 72 65 6d 65 6e 74 20 |...// in|crement |
|00000ac0| 73 63 72 61 70 20 63 6f | 75 6e 74 65 72 0d 09 09 |scrap co|unter...|
|00000ad0| 70 53 63 72 61 70 20 3d | 20 2a 20 28 54 45 53 74 |pScrap =| * (TESt|
|00000ae0| 79 6c 65 53 63 72 61 70 | 48 61 6e 64 6c 65 29 20 |yleScrap|Handle) |
|00000af0| 68 53 74 79 6c 65 53 63 | 72 61 70 3b 0d 09 09 70 |hStyleSc|rap;...p|
|00000b00| 53 63 72 61 70 2d 3e 73 | 63 72 70 4e 53 74 79 6c |Scrap->s|crpNStyl|
|00000b10| 65 73 2b 2b 3b 0d 0d 09 | 7d 20 2f 2f 20 69 66 20 |es++;...|} // if |
|00000b20| 6e 6f 74 20 5f 57 45 42 | 6c 6f 63 6b 43 6d 70 0d |not _WEB|lockCmp.|
|00000b30| 0d 09 2f 2f 20 72 65 74 | 75 72 6e 20 72 65 73 75 |..// ret|urn resu|
|00000b40| 6c 74 20 63 6f 64 65 0d | 09 72 65 74 75 72 6e 20 |lt code.|.return |
|00000b50| 6e 6f 45 72 72 3b 0d 7d | 0d 0d 23 69 66 20 57 41 |noErr;.}|..#if WA|
|00000b60| 53 54 45 5f 4f 42 4a 45 | 43 54 53 0d 0d 70 61 73 |STE_OBJE|CTS..pas|
|00000b70| 63 61 6c 20 4f 53 45 72 | 72 20 5f 57 45 53 6f 75 |cal OSEr|r _WESou|
|00000b80| 70 4f 62 6a 65 63 74 28 | 57 45 53 6f 75 70 48 61 |pObject(|WESoupHa|
|00000b90| 6e 64 6c 65 20 2a 68 4f | 62 6a 65 63 74 53 6f 75 |ndle *hO|bjectSou|
|00000ba0| 70 2c 20 63 6f 6e 73 74 | 20 57 45 52 75 6e 49 6e |p, const| WERunIn|
|00000bb0| 66 6f 50 72 69 76 20 2a | 69 6e 66 6f 2c 20 53 49 |foPriv *|info, SI|
|00000bc0| 6e 74 33 32 20 6f 66 66 | 73 65 74 29 0d 7b 0d 09 |nt32 off|set).{..|
|00000bd0| 2f 2f 20 69 66 20 69 6e | 66 6f 20 64 65 73 63 72 |// if in|fo descr|
|00000be0| 69 62 65 73 20 61 6e 20 | 65 6d 62 65 64 64 65 64 |ibes an |embedded|
|00000bf0| 20 6f 62 6a 65 63 74 2c | 20 61 70 70 65 6e 64 20 | object,| append |
|00000c00| 61 20 6e 65 77 20 6f 62 | 6a 65 63 74 20 64 65 73 |a new ob|ject des|
|00000c10| 63 72 69 70 74 6f 72 2c | 0d 09 2f 2f 20 63 6f 6d |criptor,|..// com|
|00000c20| 70 6c 65 74 65 20 77 69 | 74 68 20 74 68 65 20 61 |plete wi|th the a|
|00000c30| 73 73 6f 63 69 61 74 65 | 64 20 6f 62 6a 65 63 74 |ssociate|d object|
|00000c40| 20 64 61 74 61 2c 20 74 | 6f 20 74 68 65 20 73 70 | data, t|o the sp|
|00000c50| 65 63 69 66 69 65 64 20 | 73 6f 75 70 2e 0d 0d 09 |ecified |soup....|
|00000c60| 57 45 4f 62 6a 65 63 74 | 44 65 73 63 48 61 6e 64 |WEObject|DescHand|
|00000c70| 6c 65 20 68 4f 62 6a 65 | 63 74 44 65 73 63 20 3d |le hObje|ctDesc =|
|00000c80| 20 69 6e 66 6f 2d 3e 72 | 75 6e 41 74 74 72 73 2e | info->r|unAttrs.|
|00000c90| 72 75 6e 53 74 79 6c 65 | 2e 74 73 4f 62 6a 65 63 |runStyle|.tsObjec|
|00000ca0| 74 3b 0d 09 48 61 6e 64 | 6c 65 20 68 4f 62 6a 65 |t;..Hand|le hObje|
|00000cb0| 63 74 44 61 74 61 20 3d | 20 6e 69 6c 3b 0d 09 42 |ctData =| nil;..B|
|00000cc0| 6f 6f 6c 65 61 6e 20 64 | 69 73 70 6f 73 65 44 61 |oolean d|isposeDa|
|00000cd0| 74 61 20 3d 20 66 61 6c | 73 65 3b 0d 09 4f 53 45 |ta = fal|se;..OSE|
|00000ce0| 72 72 20 65 72 72 20 3d | 20 6e 6f 45 72 72 3b 0d |rr err =| noErr;.|
|00000cf0| 0d 09 2a 68 4f 62 6a 65 | 63 74 53 6f 75 70 20 3d |..*hObje|ctSoup =|
|00000d00| 20 6e 69 6c 3b 0d 0d 09 | 69 66 20 28 68 4f 62 6a | nil;...|if (hObj|
|00000d10| 65 63 74 44 65 73 63 20 | 21 3d 20 6e 69 6c 29 0d |ectDesc |!= nil).|
|00000d20| 09 7b 0d 09 09 46 6c 61 | 76 6f 72 54 79 70 65 20 |.{...Fla|vorType |
|00000d30| 6f 62 6a 65 63 74 54 79 | 70 65 3b 0d 09 09 57 45 |objectTy|pe;...WE|
|00000d40| 53 6f 75 70 20 73 6f 75 | 70 3b 0d 0d 09 09 2f 2f |Soup sou|p;....//|
|00000d50| 20 63 72 65 61 74 65 20 | 61 20 74 65 6d 70 6f 72 | create |a tempor|
|00000d60| 61 72 79 20 68 61 6e 64 | 6c 65 20 66 6f 72 20 74 |ary hand|le for t|
|00000d70| 68 65 20 73 74 72 65 61 | 6d 69 6e 67 20 63 61 6c |he strea|ming cal|
|00000d80| 6c 62 61 63 6b 0d 09 09 | 69 66 20 28 28 65 72 72 |lback...|if ((err|
|00000d90| 20 3d 20 5f 57 45 41 6c | 6c 6f 63 61 74 65 28 30 | = _WEAl|locate(0|
|00000da0| 2c 20 6b 41 6c 6c 6f 63 | 54 65 6d 70 2c 20 26 68 |, kAlloc|Temp, &h|
|00000db0| 4f 62 6a 65 63 74 44 61 | 74 61 29 29 20 21 3d 20 |ObjectDa|ta)) != |
|00000dc0| 6e 6f 45 72 72 29 0d 09 | 09 7b 0d 09 09 09 67 6f |noErr)..|.{....go|
|00000dd0| 74 6f 20 63 6c 65 61 6e | 75 70 3b 0d 09 09 7d 0d |to clean|up;...}.|
|00000de0| 0d 09 09 2f 2f 20 67 65 | 74 20 74 68 65 20 6f 62 |...// ge|t the ob|
|00000df0| 6a 65 63 74 20 74 79 70 | 65 2f 64 61 74 61 0d 09 |ject typ|e/data..|
|00000e00| 09 69 66 20 28 28 65 72 | 72 20 3d 20 5f 57 45 53 |.if ((er|r = _WES|
|00000e10| 74 72 65 61 6d 4f 62 6a | 65 63 74 28 77 65 54 6f |treamObj|ect(weTo|
|00000e20| 53 6f 75 70 2c 20 26 6f | 62 6a 65 63 74 54 79 70 |Soup, &o|bjectTyp|
|00000e30| 65 2c 20 26 68 4f 62 6a | 65 63 74 44 61 74 61 2c |e, &hObj|ectData,|
|00000e40| 20 26 64 69 73 70 6f 73 | 65 44 61 74 61 2c 20 68 | &dispos|eData, h|
|00000e50| 4f 62 6a 65 63 74 44 65 | 73 63 29 29 20 21 3d 20 |ObjectDe|sc)) != |
|00000e60| 6e 6f 45 72 72 29 0d 09 | 09 7b 0d 09 09 09 67 6f |noErr)..|.{....go|
|00000e70| 74 6f 20 63 6c 65 61 6e | 75 70 3b 0d 09 09 7d 0d |to clean|up;...}.|
|00000e80| 0d 09 09 2f 2f 20 66 69 | 6c 6c 20 69 6e 20 61 20 |...// fi|ll in a |
|00000e90| 73 6f 75 70 20 69 74 65 | 6d 0d 09 09 42 4c 4f 43 |soup ite|m...BLOC|
|00000ea0| 4b 5f 43 4c 52 28 73 6f | 75 70 29 3b 0d 09 09 73 |K_CLR(so|up);...s|
|00000eb0| 6f 75 70 2e 73 6f 75 70 | 4f 66 66 73 65 74 20 3d |oup.soup|Offset =|
|00000ec0| 20 6f 66 66 73 65 74 3b | 0d 09 09 73 6f 75 70 2e | offset;|...soup.|
|00000ed0| 73 6f 75 70 54 79 70 65 | 20 3d 20 6f 62 6a 65 63 |soupType| = objec|
|00000ee0| 74 54 79 70 65 3b 0d 09 | 09 73 6f 75 70 2e 73 6f |tType;..|.soup.so|
|00000ef0| 75 70 53 69 7a 65 20 3d | 20 28 2a 68 4f 62 6a 65 |upSize =| (*hObje|
|00000f00| 63 74 44 65 73 63 29 2d | 3e 6f 62 6a 65 63 74 53 |ctDesc)-|>objectS|
|00000f10| 69 7a 65 3b 0d 09 09 73 | 6f 75 70 2e 73 6f 75 70 |ize;...s|oup.soup|
|00000f20| 44 61 74 61 53 69 7a 65 | 20 3d 20 47 65 74 48 61 |DataSize| = GetHa|
|00000f30| 6e 64 6c 65 53 69 7a 65 | 28 68 4f 62 6a 65 63 74 |ndleSize|(hObject|
|00000f40| 44 61 74 61 29 3b 0d 0d | 09 09 2f 2f 20 6d 6f 76 |Data);..|..// mov|
|00000f50| 65 20 69 74 20 74 6f 20 | 74 68 65 20 73 6f 75 70 |e it to |the soup|
|00000f60| 20 68 61 6e 64 6c 65 0d | 09 09 69 66 20 28 28 65 | handle.|..if ((e|
|00000f70| 72 72 20 3d 20 5f 57 45 | 41 6c 6c 6f 63 61 74 65 |rr = _WE|Allocate|
|00000f80| 28 73 69 7a 65 6f 66 28 | 73 6f 75 70 29 2c 20 6b |(sizeof(|soup), k|
|00000f90| 41 6c 6c 6f 63 54 65 6d | 70 2c 20 68 4f 62 6a 65 |AllocTem|p, hObje|
|00000fa0| 63 74 53 6f 75 70 29 29 | 20 21 3d 20 6e 6f 45 72 |ctSoup))| != noEr|
|00000fb0| 72 29 0d 09 09 7b 0d 09 | 09 09 67 6f 74 6f 20 63 |r)...{..|..goto c|
|00000fc0| 6c 65 61 6e 75 70 3b 0d | 09 09 7d 0d 0d 09 09 42 |leanup;.|..}....B|
|00000fd0| 6c 6f 63 6b 4d 6f 76 65 | 44 61 74 61 28 26 73 6f |lockMove|Data(&so|
|00000fe0| 75 70 2c 20 2a 2a 68 4f | 62 6a 65 63 74 53 6f 75 |up, **hO|bjectSou|
|00000ff0| 70 2c 20 73 69 7a 65 6f | 66 28 73 6f 75 70 29 29 |p, sizeo|f(soup))|
|00001000| 3b 0d 0d 09 09 2f 2f 20 | 61 70 70 65 6e 64 20 74 |;....// |append t|
|00001010| 68 65 20 61 63 74 75 61 | 6c 20 6f 62 6a 65 63 74 |he actua|l object|
|00001020| 20 64 61 74 61 20 74 6f | 20 74 68 65 20 73 6f 75 | data to| the sou|
|00001030| 70 20 68 61 6e 64 6c 65 | 0d 09 09 7b 0d 09 09 09 |p handle|...{....|
|00001040| 42 6f 6f 6c 65 61 6e 20 | 73 61 76 65 44 61 74 61 |Boolean |saveData|
|00001050| 4c 6f 63 6b 20 3d 20 5f | 57 45 53 65 74 48 61 6e |Lock = _|WESetHan|
|00001060| 64 6c 65 4c 6f 63 6b 28 | 68 4f 62 6a 65 63 74 44 |dleLock(|hObjectD|
|00001070| 61 74 61 2c 20 74 72 75 | 65 29 3b 0d 09 09 09 65 |ata, tru|e);....e|
|00001080| 72 72 20 3d 20 5f 57 45 | 53 70 6c 69 63 65 28 2a |rr = _WE|Splice(*|
|00001090| 68 4f 62 6a 65 63 74 53 | 6f 75 70 2c 20 2a 68 4f |hObjectS|oup, *hO|
|000010a0| 62 6a 65 63 74 44 61 74 | 61 2c 20 73 6f 75 70 2e |bjectDat|a, soup.|
|000010b0| 73 6f 75 70 44 61 74 61 | 53 69 7a 65 2c 20 2d 31 |soupData|Size, -1|
|000010c0| 29 3b 0d 09 09 09 5f 57 | 45 53 65 74 48 61 6e 64 |);...._W|ESetHand|
|000010d0| 6c 65 4c 6f 63 6b 28 68 | 4f 62 6a 65 63 74 44 61 |leLock(h|ObjectDa|
|000010e0| 74 61 2c 20 73 61 76 65 | 44 61 74 61 4c 6f 63 6b |ta, save|DataLock|
|000010f0| 29 3b 0d 09 09 7d 0d 09 | 7d 20 2f 2f 20 69 66 20 |);...}..|} // if |
|00001100| 6f 62 6a 65 63 74 20 72 | 65 66 65 72 65 6e 63 65 |object r|eference|
|00001110| 20 69 73 20 6e 6f 74 20 | 6e 69 6c 0d 0d 63 6c 65 | is not |nil..cle|
|00001120| 61 6e 75 70 3a 0d 09 69 | 66 20 28 64 69 73 70 6f |anup:..i|f (dispo|
|00001130| 73 65 44 61 74 61 29 0d | 09 7b 0d 09 09 5f 57 45 |seData).|.{..._WE|
|00001140| 46 6f 72 67 65 74 48 61 | 6e 64 6c 65 28 26 68 4f |ForgetHa|ndle(&hO|
|00001150| 62 6a 65 63 74 44 61 74 | 61 29 3b 0d 09 7d 0d 0d |bjectDat|a);..}..|
|00001160| 09 72 65 74 75 72 6e 20 | 65 72 72 3b 0d 0d 7d 0d |.return |err;..}.|
|00001170| 0d 70 61 73 63 61 6c 20 | 4f 53 45 72 72 20 5f 57 |.pascal |OSErr _W|
|00001180| 45 50 72 65 70 65 6e 64 | 4f 62 6a 65 63 74 28 57 |EPrepend|Object(W|
|00001190| 45 53 6f 75 70 48 61 6e | 64 6c 65 20 68 53 6f 75 |ESoupHan|dle hSou|
|000011a0| 70 2c 20 63 6f 6e 73 74 | 20 57 45 52 75 6e 49 6e |p, const| WERunIn|
|000011b0| 66 6f 50 72 69 76 20 2a | 69 6e 66 6f 2c 20 53 49 |foPriv *|info, SI|
|000011c0| 6e 74 33 32 20 6f 66 66 | 73 65 74 44 65 6c 74 61 |nt32 off|setDelta|
|000011d0| 29 0d 7b 0d 09 2f 2f 20 | 69 66 20 69 6e 66 6f 20 |).{..// |if info |
|000011e0| 64 65 73 63 72 69 62 65 | 73 20 61 6e 20 65 6d 62 |describe|s an emb|
|000011f0| 65 64 64 65 64 20 6f 62 | 6a 65 63 74 2c 20 70 72 |edded ob|ject, pr|
|00001200| 65 70 65 6e 64 20 61 20 | 6e 65 77 20 6f 62 6a 65 |epend a |new obje|
|00001210| 63 74 20 64 65 73 63 72 | 69 70 74 6f 72 2c 0d 09 |ct descr|iptor,..|
|00001220| 2f 2f 20 63 6f 6d 70 6c | 65 74 65 20 77 69 74 68 |// compl|ete with|
|00001230| 20 74 68 65 20 61 73 73 | 6f 63 69 61 74 65 64 20 | the ass|ociated |
|00001240| 6f 62 6a 65 63 74 20 64 | 61 74 61 2c 20 74 6f 20 |object d|ata, to |
|00001250| 74 68 65 20 73 70 65 63 | 69 66 69 65 64 20 73 6f |the spec|ified so|
|00001260| 75 70 2e 0d 09 2f 2f 20 | 69 6e 20 61 6e 79 20 63 |up...// |in any c|
|00001270| 61 73 65 2c 20 61 64 76 | 61 6e 63 65 20 61 6c 6c |ase, adv|ance all|
|00001280| 20 63 68 61 72 61 63 74 | 65 72 20 6f 66 66 73 65 | charact|er offse|
|00001290| 74 73 20 69 6e 20 74 68 | 65 20 73 6f 75 70 20 62 |ts in th|e soup b|
|000012a0| 79 20 6f 66 66 73 65 74 | 44 65 6c 74 61 0d 0d 09 |y offset|Delta...|
|000012b0| 48 61 6e 64 6c 65 20 68 | 4f 62 6a 65 63 74 53 6f |Handle h|ObjectSo|
|000012c0| 75 70 20 3d 20 6e 69 6c | 3b 0d 09 4f 53 45 72 72 |up = nil|;..OSErr|
|000012d0| 20 65 72 72 20 3d 20 6e | 6f 45 72 72 3b 0d 0d 09 | err = n|oErr;...|
|000012e0| 2f 2f 20 63 6f 6e 76 65 | 72 74 20 74 68 65 20 6f |// conve|rt the o|
|000012f0| 62 6a 65 63 74 20 74 6f | 20 73 6f 75 70 0d 09 65 |bject to| soup..e|
|00001300| 72 72 20 3d 20 5f 57 45 | 53 6f 75 70 4f 62 6a 65 |rr = _WE|SoupObje|
|00001310| 63 74 28 26 68 4f 62 6a | 65 63 74 53 6f 75 70 2c |ct(&hObj|ectSoup,|
|00001320| 20 69 6e 66 6f 2c 20 30 | 29 3b 0d 09 69 66 20 28 | info, 0|);..if (|
|00001330| 65 72 72 20 21 3d 20 6e | 6f 45 72 72 29 0d 09 09 |err != n|oErr)...|
|00001340| 67 6f 74 6f 20 63 6c 65 | 61 6e 75 70 3b 0d 0d 09 |goto cle|anup;...|
|00001350| 2f 2f 20 70 72 65 70 65 | 6e 64 20 74 68 65 20 6f |// prepe|nd the o|
|00001360| 62 6a 65 63 74 20 73 6f | 75 70 20 74 6f 20 74 68 |bject so|up to th|
|00001370| 65 20 73 6f 75 70 20 68 | 61 6e 64 6c 65 0d 09 65 |e soup h|andle..e|
|00001380| 72 72 20 3d 20 5f 57 45 | 50 72 65 70 65 6e 64 53 |rr = _WE|PrependS|
|00001390| 6f 75 70 28 68 53 6f 75 | 70 2c 20 68 4f 62 6a 65 |oup(hSou|p, hObje|
|000013a0| 63 74 53 6f 75 70 2c 20 | 6f 66 66 73 65 74 44 65 |ctSoup, |offsetDe|
|000013b0| 6c 74 61 29 3b 0d 09 69 | 66 20 28 65 72 72 20 21 |lta);..i|f (err !|
|000013c0| 3d 20 6e 6f 45 72 72 29 | 0d 09 09 67 6f 74 6f 20 |= noErr)|...goto |
|000013d0| 63 6c 65 61 6e 75 70 3b | 0d 0d 09 2f 2f 20 69 66 |cleanup;|...// if|
|000013e0| 20 74 68 65 72 65 20 69 | 73 20 61 20 73 74 79 6c | there i|s a styl|
|000013f0| 65 72 2c 20 70 72 65 70 | 65 6e 64 20 69 74 20 74 |er, prep|end it t|
|00001400| 6f 20 74 68 65 20 73 6f | 75 70 2c 0d 09 2f 2f 20 |o the so|up,..// |
|00001410| 62 75 74 20 67 69 76 65 | 20 61 6e 20 6f 66 66 73 |but give| an offs|
|00001420| 65 74 44 65 6c 74 61 20 | 6f 66 20 30 20 73 6f 20 |etDelta |of 0 so |
|00001430| 74 68 65 20 63 68 61 72 | 61 63 74 65 72 20 6f 66 |the char|acter of|
|00001440| 66 73 65 74 73 0d 09 2f | 2f 20 77 6f 6e 27 74 20 |fsets../|/ won't |
|00001450| 62 65 20 61 64 76 61 6e | 63 65 64 20 74 77 69 63 |be advan|ced twic|
|00001460| 65 0d 09 65 72 72 20 3d | 20 5f 57 45 50 72 65 70 |e..err =| _WEPrep|
|00001470| 65 6e 64 53 74 79 6c 65 | 72 28 68 53 6f 75 70 2c |endStyle|r(hSoup,|
|00001480| 20 69 6e 66 6f 2c 20 30 | 29 3b 0d 0d 63 6c 65 61 | info, 0|);..clea|
|00001490| 6e 75 70 3a 0d 09 5f 57 | 45 46 6f 72 67 65 74 48 |nup:.._W|EForgetH|
|000014a0| 61 6e 64 6c 65 28 26 68 | 4f 62 6a 65 63 74 53 6f |andle(&h|ObjectSo|
|000014b0| 75 70 29 3b 0d 0d 09 72 | 65 74 75 72 6e 20 65 72 |up);...r|eturn er|
|000014c0| 72 3b 0d 0d 7d 0d 0d 70 | 61 73 63 61 6c 20 4f 53 |r;..}..p|ascal OS|
|000014d0| 45 72 72 20 5f 57 45 41 | 70 70 65 6e 64 4f 62 6a |Err _WEA|ppendObj|
|000014e0| 65 63 74 28 57 45 53 6f | 75 70 48 61 6e 64 6c 65 |ect(WESo|upHandle|
|000014f0| 20 68 53 6f 75 70 2c 20 | 63 6f 6e 73 74 20 57 45 | hSoup, |const WE|
|00001500| 52 75 6e 49 6e 66 6f 50 | 72 69 76 20 2a 69 6e 66 |RunInfoP|riv *inf|
|00001510| 6f 2c 20 53 49 6e 74 33 | 32 20 6f 66 66 73 65 74 |o, SInt3|2 offset|
|00001520| 29 0d 7b 0d 09 2f 2f 20 | 69 66 20 69 6e 66 6f 20 |).{..// |if info |
|00001530| 64 65 73 63 72 69 62 65 | 73 20 61 6e 20 65 6d 62 |describe|s an emb|
|00001540| 65 64 64 65 64 20 6f 62 | 6a 65 63 74 2c 20 61 70 |edded ob|ject, ap|
|00001550| 70 65 6e 64 20 61 20 6e | 65 77 20 6f 62 6a 65 63 |pend a n|ew objec|
|00001560| 74 20 64 65 73 63 72 69 | 70 74 6f 72 2c 0d 09 2f |t descri|ptor,../|
|00001570| 2f 20 63 6f 6d 70 6c 65 | 74 65 20 77 69 74 68 20 |/ comple|te with |
|00001580| 74 68 65 20 61 73 73 6f | 63 69 61 74 65 64 20 6f |the asso|ciated o|
|00001590| 62 6a 65 63 74 20 64 61 | 74 61 2c 20 74 6f 20 74 |bject da|ta, to t|
|000015a0| 68 65 20 73 70 65 63 69 | 66 69 65 64 20 73 6f 75 |he speci|fied sou|
|000015b0| 70 2e 0d 0d 09 48 61 6e | 64 6c 65 20 68 4f 62 6a |p....Han|dle hObj|
|000015c0| 65 63 74 53 6f 75 70 20 | 3d 20 6e 69 6c 3b 0d 09 |ectSoup |= nil;..|
|000015d0| 4f 53 45 72 72 20 65 72 | 72 3b 0d 0d 09 2f 2f 20 |OSErr er|r;...// |
|000015e0| 63 6f 6e 76 65 72 74 20 | 74 68 65 20 6f 62 6a 65 |convert |the obje|
|000015f0| 63 74 20 74 6f 20 73 6f | 75 70 0d 09 65 72 72 20 |ct to so|up..err |
|00001600| 3d 20 5f 57 45 53 6f 75 | 70 4f 62 6a 65 63 74 28 |= _WESou|pObject(|
|00001610| 26 68 4f 62 6a 65 63 74 | 53 6f 75 70 2c 20 69 6e |&hObject|Soup, in|
|00001620| 66 6f 2c 20 6f 66 66 73 | 65 74 29 3b 0d 09 69 66 |fo, offs|et);..if|
|00001630| 20 28 65 72 72 20 21 3d | 20 6e 6f 45 72 72 29 0d | (err !=| noErr).|
|00001640| 09 09 67 6f 74 6f 20 63 | 6c 65 61 6e 75 70 3b 0d |..goto c|leanup;.|
|00001650| 0d 09 2f 2f 20 61 70 70 | 70 65 6e 64 20 74 68 65 |..// app|pend the|
|00001660| 20 6f 62 6a 65 63 74 20 | 73 6f 75 70 20 74 6f 20 | object |soup to |
|00001670| 74 68 65 20 73 6f 75 70 | 20 68 61 6e 64 6c 65 0d |the soup| handle.|
|00001680| 09 65 72 72 20 3d 20 5f | 57 45 41 70 70 65 6e 64 |.err = _|WEAppend|
|00001690| 53 6f 75 70 28 68 53 6f | 75 70 2c 20 68 4f 62 6a |Soup(hSo|up, hObj|
|000016a0| 65 63 74 53 6f 75 70 29 | 3b 0d 09 69 66 20 28 65 |ectSoup)|;..if (e|
|000016b0| 72 72 20 21 3d 20 6e 6f | 45 72 72 29 0d 09 09 67 |rr != no|Err)...g|
|000016c0| 6f 74 6f 20 63 6c 65 61 | 6e 75 70 3b 0d 0d 09 2f |oto clea|nup;.../|
|000016d0| 2f 20 69 66 20 74 68 65 | 72 65 20 69 73 20 61 20 |/ if the|re is a |
|000016e0| 73 74 79 6c 65 72 2c 20 | 61 70 70 65 6e 64 20 69 |styler, |append i|
|000016f0| 74 20 74 6f 20 74 68 65 | 20 73 6f 75 70 2c 0d 09 |t to the| soup,..|
|00001700| 65 72 72 20 3d 20 5f 57 | 45 41 70 70 65 6e 64 53 |err = _W|EAppendS|
|00001710| 74 79 6c 65 72 28 68 53 | 6f 75 70 2c 20 69 6e 66 |tyler(hS|oup, inf|
|00001720| 6f 2c 20 6f 66 66 73 65 | 74 29 3b 0d 0d 63 6c 65 |o, offse|t);..cle|
|00001730| 61 6e 75 70 3a 0d 09 5f | 57 45 46 6f 72 67 65 74 |anup:.._|WEForget|
|00001740| 48 61 6e 64 6c 65 28 26 | 68 4f 62 6a 65 63 74 53 |Handle(&|hObjectS|
|00001750| 6f 75 70 29 3b 0d 0d 09 | 72 65 74 75 72 6e 20 65 |oup);...|return e|
|00001760| 72 72 3b 0d 0d 7d 0d 0d | 70 61 73 63 61 6c 20 4f |rr;..}..|pascal O|
|00001770| 53 45 72 72 20 5f 57 45 | 50 72 65 70 65 6e 64 53 |SErr _WE|PrependS|
|00001780| 6f 75 70 28 57 45 53 6f | 75 70 48 61 6e 64 6c 65 |oup(WESo|upHandle|
|00001790| 20 68 53 6f 75 70 2c 20 | 63 6f 6e 73 74 20 57 45 | hSoup, |const WE|
|000017a0| 53 6f 75 70 48 61 6e 64 | 6c 65 20 6d 6f 72 65 53 |SoupHand|le moreS|
|000017b0| 6f 75 70 2c 20 53 49 6e | 74 33 32 20 6f 66 66 73 |oup, SIn|t32 offs|
|000017c0| 65 74 44 65 6c 74 61 29 | 0d 7b 0d 09 2f 2f 20 70 |etDelta)|.{..// p|
|000017d0| 72 65 70 65 6e 64 20 61 | 20 6e 65 77 20 73 6f 75 |repend a| new sou|
|000017e0| 70 20 68 61 6e 64 6c 65 | 20 74 6f 20 74 68 65 20 |p handle| to the |
|000017f0| 73 70 65 63 69 66 69 65 | 64 20 73 6f 75 70 2e 0d |specifie|d soup..|
|00001800| 09 2f 2f 20 69 6e 20 61 | 6e 79 20 63 61 73 65 2c |.// in a|ny case,|
|00001810| 20 61 64 76 61 6e 63 65 | 20 61 6c 6c 20 63 68 61 | advance| all cha|
|00001820| 72 61 63 74 65 72 20 6f | 66 66 73 65 74 73 20 69 |racter o|ffsets i|
|00001830| 6e 20 74 68 65 20 73 6f | 75 70 20 62 79 20 6f 66 |n the so|up by of|
|00001840| 66 73 65 74 44 65 6c 74 | 61 0d 0d 09 53 69 7a 65 |fsetDelt|a...Size|
|00001850| 20 73 6f 75 70 53 69 7a | 65 3b 0d 09 53 69 7a 65 | soupSiz|e;..Size|
|00001860| 20 65 78 74 72 61 53 69 | 7a 65 20 3d 20 30 3b 0d | extraSi|ze = 0;.|
|00001870| 09 4f 53 45 72 72 20 65 | 72 72 20 3d 20 6e 6f 45 |.OSErr e|rr = noE|
|00001880| 72 72 3b 0d 0d 09 2f 2f | 20 67 65 74 20 73 69 7a |rr;...//| get siz|
|00001890| 65 20 6f 66 20 65 78 69 | 73 74 69 6e 67 20 73 6f |e of exi|sting so|
|000018a0| 75 70 0d 09 73 6f 75 70 | 53 69 7a 65 20 3d 20 47 |up..soup|Size = G|
|000018b0| 65 74 48 61 6e 64 6c 65 | 53 69 7a 65 28 68 53 6f |etHandle|Size(hSo|
|000018c0| 75 70 29 3b 0d 0d 09 69 | 66 20 28 6d 6f 72 65 53 |up);...i|f (moreS|
|000018d0| 6f 75 70 20 21 3d 20 6e | 69 6c 29 0d 09 7b 0d 09 |oup != n|il)..{..|
|000018e0| 09 2f 2f 20 67 65 74 20 | 73 69 7a 65 20 6f 66 20 |.// get |size of |
|000018f0| 73 74 79 6c 65 72 20 64 | 61 74 61 0d 09 09 2f 2f |styler d|ata...//|
|00001900| 20 65 78 74 72 61 53 69 | 7a 65 20 69 73 20 73 69 | extraSi|ze is si|
|00001910| 7a 65 20 6f 66 20 64 65 | 73 63 72 69 70 74 6f 72 |ze of de|scriptor|
|00001920| 20 2b 20 73 69 7a 65 20 | 6f 66 20 73 74 79 6c 65 | + size |of style|
|00001930| 72 20 64 61 74 61 0d 09 | 09 65 78 74 72 61 53 69 |r data..|.extraSi|
|00001940| 7a 65 20 3d 20 47 65 74 | 48 61 6e 64 6c 65 53 69 |ze = Get|HandleSi|
|00001950| 7a 65 28 6d 6f 72 65 53 | 6f 75 70 29 3b 0d 0d 09 |ze(moreS|oup);...|
|00001960| 09 2f 2f 20 69 6e 73 65 | 72 74 20 74 68 65 20 6e |.// inse|rt the n|
|00001970| 65 77 20 73 6f 75 70 20 | 61 74 20 74 68 65 20 62 |ew soup |at the b|
|00001980| 65 67 69 6e 6e 69 6e 67 | 0d 09 09 7b 0d 09 09 09 |eginning|...{....|
|00001990| 42 6f 6f 6c 65 61 6e 20 | 73 61 76 65 44 61 74 61 |Boolean |saveData|
|000019a0| 4c 6f 63 6b 20 3d 20 5f | 57 45 53 65 74 48 61 6e |Lock = _|WESetHan|
|000019b0| 64 6c 65 4c 6f 63 6b 28 | 6d 6f 72 65 53 6f 75 70 |dleLock(|moreSoup|
|000019c0| 2c 20 74 72 75 65 29 3b | 0d 09 09 09 65 72 72 20 |, true);|....err |
|000019d0| 3d 20 5f 57 45 53 70 6c | 69 63 65 28 68 53 6f 75 |= _WESpl|ice(hSou|
|000019e0| 70 2c 20 2a 6d 6f 72 65 | 53 6f 75 70 2c 20 65 78 |p, *more|Soup, ex|
|000019f0| 74 72 61 53 69 7a 65 2c | 20 30 29 3b 0d 09 09 09 |traSize,| 0);....|
|00001a00| 5f 57 45 53 65 74 48 61 | 6e 64 6c 65 4c 6f 63 6b |_WESetHa|ndleLock|
|00001a10| 28 6d 6f 72 65 53 6f 75 | 70 2c 20 73 61 76 65 44 |(moreSou|p, saveD|
|00001a20| 61 74 61 4c 6f 63 6b 29 | 3b 0d 09 09 7d 0d 09 09 |ataLock)|;...}...|
|00001a30| 69 66 20 28 65 72 72 20 | 21 3d 20 6e 6f 45 72 72 |if (err |!= noErr|
|00001a40| 29 0d 09 09 09 67 6f 74 | 6f 20 63 6c 65 61 6e 75 |)....got|o cleanu|
|00001a50| 70 3b 0d 09 7d 0d 0d 09 | 2f 2f 20 75 70 64 61 74 |p;..}...|// updat|
|00001a60| 65 20 63 68 61 72 20 6f | 66 66 73 65 74 73 20 77 |e char o|ffsets w|
|00001a70| 69 74 68 69 6e 20 74 68 | 65 20 73 6f 75 70 0d 09 |ithin th|e soup..|
|00001a80| 7b 0d 09 09 57 45 53 6f | 75 70 20 73 6f 75 70 3b |{...WESo|up soup;|
|00001a90| 0d 09 09 50 74 72 20 70 | 53 6f 75 70 20 3d 20 2a |...Ptr p|Soup = *|
|00001aa0| 68 53 6f 75 70 3b 0d 09 | 09 77 68 69 6c 65 20 28 |hSoup;..|.while (|
|00001ab0| 73 6f 75 70 53 69 7a 65 | 20 3e 20 30 29 0d 09 09 |soupSize| > 0)...|
|00001ac0| 7b 0d 09 09 09 70 53 6f | 75 70 20 2b 3d 20 65 78 |{....pSo|up += ex|
|00001ad0| 74 72 61 53 69 7a 65 3b | 0d 0d 09 09 09 2f 2f 09 |traSize;|.....//.|
|00001ae0| 77 65 20 68 61 76 65 20 | 74 6f 20 75 73 65 20 42 |we have |to use B|
|00001af0| 6c 6f 63 6b 4d 6f 76 65 | 44 61 74 61 20 74 6f 20 |lockMove|Data to |
|00001b00| 61 63 63 65 73 73 20 64 | 65 73 63 72 69 70 74 6f |access d|escripto|
|00001b10| 72 73 20 77 69 74 68 69 | 6e 0d 09 09 09 2f 2f 09 |rs withi|n....//.|
|00001b20| 74 68 65 20 73 6f 75 70 | 2c 20 61 73 20 74 68 65 |the soup|, as the|
|00001b30| 79 20 6d 69 67 68 74 20 | 62 65 20 6f 64 64 2d 61 |y might |be odd-a|
|00001b40| 6c 69 67 6e 65 64 20 28 | 64 75 68 21 29 20 61 6e |ligned (|duh!) an|
|00001b50| 64 20 74 68 61 74 20 77 | 6f 75 6c 64 0d 09 09 09 |d that w|ould....|
|00001b60| 2f 2f 09 63 61 75 73 65 | 20 66 61 74 61 6c 20 61 |//.cause| fatal a|
|00001b70| 64 64 72 65 73 73 20 65 | 72 72 6f 72 73 20 6f 6e |ddress e|rrors on|
|00001b80| 20 36 38 30 30 30 20 43 | 50 55 73 0d 0d 09 09 09 | 68000 C|PUs.....|
|00001b90| 42 6c 6f 63 6b 4d 6f 76 | 65 44 61 74 61 28 70 53 |BlockMov|eData(pS|
|00001ba0| 6f 75 70 2c 20 26 73 6f | 75 70 2c 20 73 69 7a 65 |oup, &so|up, size|
|00001bb0| 6f 66 28 73 6f 75 70 29 | 29 3b 0d 09 09 09 73 6f |of(soup)|);....so|
|00001bc0| 75 70 2e 73 6f 75 70 4f | 66 66 73 65 74 20 2b 3d |up.soupO|ffset +=|
|00001bd0| 20 6f 66 66 73 65 74 44 | 65 6c 74 61 3b 0d 09 09 | offsetD|elta;...|
|00001be0| 09 42 6c 6f 63 6b 4d 6f | 76 65 44 61 74 61 28 26 |.BlockMo|veData(&|
|00001bf0| 73 6f 75 70 2c 20 70 53 | 6f 75 70 2c 20 73 69 7a |soup, pS|oup, siz|
|00001c00| 65 6f 66 28 73 6f 75 70 | 29 29 3b 0d 09 09 09 65 |eof(soup|));....e|
|00001c10| 78 74 72 61 53 69 7a 65 | 20 3d 20 73 69 7a 65 6f |xtraSize| = sizeo|
|00001c20| 66 28 73 6f 75 70 29 20 | 2b 20 73 6f 75 70 2e 73 |f(soup) |+ soup.s|
|00001c30| 6f 75 70 44 61 74 61 53 | 69 7a 65 3b 0d 09 09 09 |oupDataS|ize;....|
|00001c40| 73 6f 75 70 53 69 7a 65 | 20 2d 3d 20 65 78 74 72 |soupSize| -= extr|
|00001c50| 61 53 69 7a 65 3b 0d 09 | 09 7d 0d 09 7d 0d 0d 63 |aSize;..|.}..}..c|
|00001c60| 6c 65 61 6e 75 70 3a 0d | 09 72 65 74 75 72 6e 20 |leanup:.|.return |
|00001c70| 65 72 72 3b 0d 7d 0d 0d | 70 61 73 63 61 6c 20 4f |err;.}..|pascal O|
|00001c80| 53 45 72 72 20 5f 57 45 | 41 70 70 65 6e 64 53 6f |SErr _WE|AppendSo|
|00001c90| 75 70 28 57 45 53 6f 75 | 70 48 61 6e 64 6c 65 20 |up(WESou|pHandle |
|00001ca0| 68 53 6f 75 70 2c 20 63 | 6f 6e 73 74 20 57 45 53 |hSoup, c|onst WES|
|00001cb0| 6f 75 70 48 61 6e 64 6c | 65 20 6d 6f 72 65 53 6f |oupHandl|e moreSo|
|00001cc0| 75 70 29 0d 7b 0d 09 4f | 53 45 72 72 20 65 72 72 |up).{..O|SErr err|
|00001cd0| 20 3d 20 6e 6f 45 72 72 | 3b 0d 0d 09 2f 2f 20 61 | = noErr|;...// a|
|00001ce0| 70 70 65 6e 64 20 74 68 | 65 20 6e 65 77 20 73 6f |ppend th|e new so|
|00001cf0| 75 70 20 74 6f 20 74 68 | 65 20 73 6f 75 70 20 68 |up to th|e soup h|
|00001d00| 61 6e 64 6c 65 0d 09 69 | 66 20 28 6d 6f 72 65 53 |andle..i|f (moreS|
|00001d10| 6f 75 70 20 21 3d 20 6e | 69 6c 29 0d 09 7b 0d 09 |oup != n|il)..{..|
|00001d20| 09 53 69 7a 65 20 65 78 | 74 72 61 53 69 7a 65 3b |.Size ex|traSize;|
|00001d30| 0d 09 09 42 6f 6f 6c 65 | 61 6e 20 73 61 76 65 44 |...Boole|an saveD|
|00001d40| 61 74 61 4c 6f 63 6b 3b | 0d 0d 09 09 65 78 74 72 |ataLock;|....extr|
|00001d50| 61 53 69 7a 65 20 3d 20 | 47 65 74 48 61 6e 64 6c |aSize = |GetHandl|
|00001d60| 65 53 69 7a 65 28 6d 6f | 72 65 53 6f 75 70 29 3b |eSize(mo|reSoup);|
|00001d70| 0d 0d 09 09 73 61 76 65 | 44 61 74 61 4c 6f 63 6b |....save|DataLock|
|00001d80| 20 3d 20 5f 57 45 53 65 | 74 48 61 6e 64 6c 65 4c | = _WESe|tHandleL|
|00001d90| 6f 63 6b 28 6d 6f 72 65 | 53 6f 75 70 2c 20 74 72 |ock(more|Soup, tr|
|00001da0| 75 65 29 3b 0d 09 09 65 | 72 72 20 3d 20 5f 57 45 |ue);...e|rr = _WE|
|00001db0| 53 70 6c 69 63 65 28 68 | 53 6f 75 70 2c 20 2a 6d |Splice(h|Soup, *m|
|00001dc0| 6f 72 65 53 6f 75 70 2c | 20 65 78 74 72 61 53 69 |oreSoup,| extraSi|
|00001dd0| 7a 65 2c 20 2d 31 29 3b | 0d 09 09 5f 57 45 53 65 |ze, -1);|..._WESe|
|00001de0| 74 48 61 6e 64 6c 65 4c | 6f 63 6b 28 6d 6f 72 65 |tHandleL|ock(more|
|00001df0| 53 6f 75 70 2c 20 73 61 | 76 65 44 61 74 61 4c 6f |Soup, sa|veDataLo|
|00001e00| 63 6b 29 3b 0d 09 7d 0d | 0d 09 72 65 74 75 72 6e |ck);..}.|..return|
|00001e10| 20 65 72 72 3b 0d 7d 0d | 0d 0d 23 65 6e 64 69 66 | err;.}.|..#endif|
|00001e20| 0d 0d 70 61 73 63 61 6c | 20 4f 53 45 72 72 20 57 |..pascal| OSErr W|
|00001e30| 45 43 6f 70 79 52 61 6e | 67 65 28 53 49 6e 74 33 |ECopyRan|ge(SInt3|
|00001e40| 32 20 72 61 6e 67 65 53 | 74 61 72 74 2c 20 53 49 |2 rangeS|tart, SI|
|00001e50| 6e 74 33 32 20 72 61 6e | 67 65 45 6e 64 2c 20 48 |nt32 ran|geEnd, H|
|00001e60| 61 6e 64 6c 65 20 68 54 | 65 78 74 2c 0d 09 09 09 |andle hT|ext,....|
|00001e70| 09 09 09 20 53 74 53 63 | 72 70 48 61 6e 64 6c 65 |... StSc|rpHandle|
|00001e80| 20 68 53 74 79 6c 65 73 | 2c 20 57 45 53 6f 75 70 | hStyles|, WESoup|
|00001e90| 48 61 6e 64 6c 65 20 68 | 53 6f 75 70 2c 20 57 45 |Handle h|Soup, WE|
|00001ea0| 52 65 66 65 72 65 6e 63 | 65 20 68 57 45 29 0d 7b |Referenc|e hWE).{|
|00001eb0| 0d 09 2f 2f 20 4d 61 6b | 65 20 61 20 63 6f 70 79 |..// Mak|e a copy|
|00001ec0| 20 6f 66 20 74 68 65 20 | 73 70 65 63 69 66 69 65 | of the |specifie|
|00001ed0| 64 20 72 61 6e 67 65 20 | 6f 66 20 74 65 78 74 3a |d range |of text:|
|00001ee0| 20 73 74 6f 72 65 20 74 | 68 65 20 63 68 61 72 61 | store t|he chara|
|00001ef0| 63 74 65 72 73 20 69 6e | 20 68 54 65 78 74 0d 09 |cters in| hText..|
|00001f00| 2f 2f 20 61 6e 64 20 74 | 68 65 20 61 73 73 6f 63 |// and t|he assoc|
|00001f10| 69 61 74 65 64 20 73 74 | 79 6c 65 20 73 63 72 61 |iated st|yle scra|
|00001f20| 70 20 69 6e 20 68 53 74 | 79 6c 65 73 2e 20 20 54 |p in hSt|yles. T|
|00001f30| 68 65 20 68 61 6e 64 6c | 65 73 20 61 72 65 20 72 |he handl|es are r|
|00001f40| 65 73 69 7a 65 64 20 61 | 73 20 6e 65 63 65 73 73 |esized a|s necess|
|00001f50| 61 72 79 2e 0d 09 2f 2f | 20 53 70 65 63 69 66 79 |ary...//| Specify|
|00001f60| 20 6e 69 6c 20 69 6e 20 | 68 54 65 78 74 20 6f 72 | nil in |hText or|
|00001f70| 20 68 53 74 79 6c 65 73 | 20 69 66 20 79 6f 75 20 | hStyles| if you |
|00001f80| 64 6f 6e 27 74 20 77 61 | 6e 74 20 74 68 65 20 63 |don't wa|nt the c|
|00001f90| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 20 69 6e 66 |orrespon|ding inf|
|00001fa0| 6f 20 72 65 74 75 72 6e | 65 64 2e 0d 0d 09 57 45 |o return|ed....WE|
|00001fb0| 50 74 72 20 70 57 45 3b | 0d 09 54 45 53 74 79 6c |Ptr pWE;|..TEStyl|
|00001fc0| 65 53 63 72 61 70 45 6c | 65 6d 65 6e 74 20 2a 70 |eScrapEl|ement *p|
|00001fd0| 45 6e 74 72 79 20 3d 20 | 6e 69 6c 3b 0d 09 53 49 |Entry = |nil;..SI|
|00001fe0| 6e 74 33 32 20 72 61 6e | 67 65 4c 65 6e 67 74 68 |nt32 ran|geLength|
|00001ff0| 3b 0d 09 53 49 6e 74 33 | 32 20 66 69 72 73 74 52 |;..SInt3|2 firstR|
|00002000| 75 6e 2c 20 6e 52 75 6e | 73 2c 20 69 3b 0d 09 53 |un, nRun|s, i;..S|
|00002010| 49 6e 74 33 32 20 73 74 | 61 72 74 43 68 61 72 3b |Int32 st|artChar;|
|00002020| 0d 09 57 45 52 75 6e 49 | 6e 66 6f 50 72 69 76 20 |..WERunI|nfoPriv |
|00002030| 69 6e 66 6f 3b 0d 09 42 | 6f 6f 6c 65 61 6e 20 73 |info;..B|oolean s|
|00002040| 61 76 65 57 45 4c 6f 63 | 6b 3b 0d 09 4f 53 45 72 |aveWELoc|k;..OSEr|
|00002050| 72 20 65 72 72 3b 0d 0d | 09 2f 2f 20 6c 6f 63 6b |r err;..|.// lock|
|00002060| 20 74 68 65 20 57 45 20 | 72 65 63 6f 72 64 0d 09 | the WE |record..|
|00002070| 73 61 76 65 57 45 4c 6f | 63 6b 20 3d 20 5f 57 45 |saveWELo|ck = _WE|
|00002080| 53 65 74 48 61 6e 64 6c | 65 4c 6f 63 6b 28 28 48 |SetHandl|eLock((H|
|00002090| 61 6e 64 6c 65 29 20 68 | 57 45 2c 20 74 72 75 65 |andle) h|WE, true|
|000020a0| 29 3b 0d 09 70 57 45 20 | 3d 20 2a 68 57 45 3b 0d |);..pWE |= *hWE;.|
|000020b0| 0d 09 2f 2f 20 72 61 6e | 67 65 2d 63 68 65 63 6b |..// ran|ge-check|
|000020c0| 20 70 61 72 61 6d 65 74 | 65 72 73 20 61 6e 64 20 | paramet|ers and |
|000020d0| 72 65 6f 72 64 65 72 20 | 74 68 65 6d 20 69 66 20 |reorder |them if |
|000020e0| 6e 65 63 65 73 73 61 72 | 79 0d 09 72 61 6e 67 65 |necessar|y..range|
|000020f0| 53 74 61 72 74 20 3d 20 | 5f 57 45 50 69 6e 49 6e |Start = |_WEPinIn|
|00002100| 52 61 6e 67 65 28 72 61 | 6e 67 65 53 74 61 72 74 |Range(ra|ngeStart|
|00002110| 2c 20 30 2c 20 70 57 45 | 2d 3e 74 65 78 74 4c 65 |, 0, pWE|->textLe|
|00002120| 6e 67 74 68 29 3b 0d 09 | 72 61 6e 67 65 45 6e 64 |ngth);..|rangeEnd|
|00002130| 20 3d 20 5f 57 45 50 69 | 6e 49 6e 52 61 6e 67 65 | = _WEPi|nInRange|
|00002140| 28 72 61 6e 67 65 45 6e | 64 2c 20 30 2c 20 70 57 |(rangeEn|d, 0, pW|
|00002150| 45 2d 3e 74 65 78 74 4c | 65 6e 67 74 68 29 3b 0d |E->textL|ength);.|
|00002160| 09 5f 57 45 52 65 6f 72 | 64 65 72 28 26 72 61 6e |._WEReor|der(&ran|
|00002170| 67 65 53 74 61 72 74 2c | 20 26 72 61 6e 67 65 45 |geStart,| &rangeE|
|00002180| 6e 64 29 3b 0d 09 72 61 | 6e 67 65 4c 65 6e 67 74 |nd);..ra|ngeLengt|
|00002190| 68 20 3d 20 72 61 6e 67 | 65 45 6e 64 20 2d 20 72 |h = rang|eEnd - r|
|000021a0| 61 6e 67 65 53 74 61 72 | 74 3b 0d 0d 09 69 66 20 |angeStar|t;...if |
|000021b0| 28 68 54 65 78 74 20 21 | 3d 20 6e 69 6c 29 0d 09 |(hText !|= nil)..|
|000021c0| 7b 0d 09 09 2f 2f 20 72 | 65 73 69 7a 65 20 74 68 |{...// r|esize th|
|000021d0| 65 20 67 69 76 65 6e 20 | 68 61 6e 64 6c 65 0d 09 |e given |handle..|
|000021e0| 09 53 65 74 48 61 6e 64 | 6c 65 53 69 7a 65 28 68 |.SetHand|leSize(h|
|000021f0| 54 65 78 74 2c 20 72 61 | 6e 67 65 4c 65 6e 67 74 |Text, ra|ngeLengt|
|00002200| 68 29 3b 0d 09 09 69 66 | 20 28 28 65 72 72 20 3d |h);...if| ((err =|
|00002210| 20 4d 65 6d 45 72 72 6f | 72 28 29 29 20 21 3d 20 | MemErro|r()) != |
|00002220| 6e 6f 45 72 72 29 0d 09 | 09 7b 0d 09 09 09 67 6f |noErr)..|.{....go|
|00002230| 74 6f 20 63 6c 65 61 6e | 75 70 3b 0d 09 09 7d 0d |to clean|up;...}.|
|00002240| 0d 09 09 2f 2f 20 63 6f | 70 79 20 74 68 65 20 74 |...// co|py the t|
|00002250| 65 78 74 20 72 61 6e 67 | 65 0d 09 09 42 6c 6f 63 |ext rang|e...Bloc|
|00002260| 6b 4d 6f 76 65 44 61 74 | 61 28 2a 70 57 45 2d 3e |kMoveDat|a(*pWE->|
|00002270| 68 54 65 78 74 20 2b 20 | 72 61 6e 67 65 53 74 61 |hText + |rangeSta|
|00002280| 72 74 2c 20 2a 68 54 65 | 78 74 2c 20 72 61 6e 67 |rt, *hTe|xt, rang|
|00002290| 65 4c 65 6e 67 74 68 29 | 3b 0d 09 7d 0d 0d 09 2f |eLength)|;..}.../|
|000022a0| 2f 20 6d 61 6b 65 20 74 | 68 65 20 73 6f 75 70 20 |/ make t|he soup |
|000022b0| 68 61 6e 64 6c 65 20 7a | 65 72 6f 2d 6c 65 6e 67 |handle z|ero-leng|
|000022c0| 74 68 0d 09 69 66 20 28 | 68 53 6f 75 70 20 21 3d |th..if (|hSoup !=|
|000022d0| 20 6e 69 6c 29 0d 09 7b | 0d 09 09 53 65 74 48 61 | nil)..{|...SetHa|
|000022e0| 6e 64 6c 65 53 69 7a 65 | 28 68 53 6f 75 70 2c 20 |ndleSize|(hSoup, |
|000022f0| 30 29 3b 0d 09 09 69 66 | 20 28 28 65 72 72 20 3d |0);...if| ((err =|
|00002300| 20 4d 65 6d 45 72 72 6f | 72 28 29 29 20 21 3d 20 | MemErro|r()) != |
|00002310| 6e 6f 45 72 72 29 0d 09 | 09 7b 0d 09 09 09 67 6f |noErr)..|.{....go|
|00002320| 74 6f 20 63 6c 65 61 6e | 75 70 3b 0d 09 09 7d 0d |to clean|up;...}.|
|00002330| 09 7d 0d 0d 09 69 66 20 | 28 28 68 53 74 79 6c 65 |.}...if |((hStyle|
|00002340| 73 20 21 3d 20 6e 69 6c | 29 20 7c 7c 20 28 68 53 |s != nil|) || (hS|
|00002350| 6f 75 70 20 21 3d 20 6e | 69 6c 29 29 0d 09 7b 0d |oup != n|il))..{.|
|00002360| 09 09 2f 2f 20 63 6f 75 | 6e 74 20 68 6f 77 20 6d |..// cou|nt how m|
|00002370| 61 6e 79 20 73 74 79 6c | 65 20 72 75 6e 73 20 74 |any styl|e runs t|
|00002380| 68 65 72 65 20 61 72 65 | 20 69 6e 20 74 68 65 20 |here are| in the |
|00002390| 73 65 6c 65 63 74 69 6f | 6e 20 72 61 6e 67 65 0d |selectio|n range.|
|000023a0| 09 09 66 69 72 73 74 52 | 75 6e 20 3d 20 57 45 4f |..firstR|un = WEO|
|000023b0| 66 66 73 65 74 54 6f 52 | 75 6e 28 72 61 6e 67 65 |ffsetToR|un(range|
|000023c0| 53 74 61 72 74 2c 20 68 | 57 45 29 3b 0d 09 09 6e |Start, h|WE);...n|
|000023d0| 52 75 6e 73 20 3d 20 57 | 45 4f 66 66 73 65 74 54 |Runs = W|EOffsetT|
|000023e0| 6f 52 75 6e 28 72 61 6e | 67 65 45 6e 64 20 2d 20 |oRun(ran|geEnd - |
|000023f0| 31 2c 20 68 57 45 29 20 | 2d 20 66 69 72 73 74 52 |1, hWE) |- firstR|
|00002400| 75 6e 20 2b 20 31 3b 0d | 0d 09 09 69 66 20 28 68 |un + 1;.|...if (h|
|00002410| 53 74 79 6c 65 73 20 21 | 3d 20 6e 69 6c 29 0d 09 |Styles !|= nil)..|
|00002420| 09 7b 0d 09 09 09 2f 2f | 20 72 65 73 69 7a 65 20 |.{....//| resize |
|00002430| 74 68 65 20 67 69 76 65 | 6e 20 73 74 79 6c 65 20 |the give|n style |
|00002440| 73 63 72 61 70 20 68 61 | 6e 64 6c 65 20 61 6e 64 |scrap ha|ndle and|
|00002450| 20 6c 6f 63 6b 20 69 74 | 20 69 6e 20 68 69 67 68 | lock it| in high|
|00002460| 20 68 65 61 70 0d 09 09 | 09 53 65 74 48 61 6e 64 | heap...|.SetHand|
|00002470| 6c 65 53 69 7a 65 28 28 | 48 61 6e 64 6c 65 29 68 |leSize((|Handle)h|
|00002480| 53 74 79 6c 65 73 2c 20 | 28 6e 52 75 6e 73 20 2a |Styles, |(nRuns *|
|00002490| 20 73 69 7a 65 6f 66 28 | 53 63 72 70 53 54 45 6c | sizeof(|ScrpSTEl|
|000024a0| 65 6d 65 6e 74 29 29 20 | 2b 20 73 69 7a 65 6f 66 |ement)) |+ sizeof|
|000024b0| 28 53 49 6e 74 31 36 29 | 29 3b 0d 09 09 09 69 66 |(SInt16)|);....if|
|000024c0| 20 28 28 65 72 72 20 3d | 20 4d 65 6d 45 72 72 6f | ((err =| MemErro|
|000024d0| 72 28 29 29 20 21 3d 20 | 6e 6f 45 72 72 29 0d 09 |r()) != |noErr)..|
|000024e0| 09 09 7b 0d 09 09 09 09 | 67 6f 74 6f 20 63 6c 65 |..{.....|goto cle|
|000024f0| 61 6e 75 70 3b 0d 09 09 | 09 7d 0d 09 09 09 48 4c |anup;...|.}....HL|
|00002500| 6f 63 6b 48 69 28 28 48 | 61 6e 64 6c 65 29 68 53 |ockHi((H|andle)hS|
|00002510| 74 79 6c 65 73 29 3b 0d | 0d 09 09 09 2f 2f 20 66 |tyles);.|....// f|
|00002520| 69 6c 6c 20 69 6e 20 74 | 68 65 20 65 6e 74 72 79 |ill in t|he entry|
|00002530| 20 63 6f 75 6e 74 20 69 | 6e 20 74 68 65 20 73 74 | count i|n the st|
|00002540| 79 6c 65 20 73 63 72 61 | 70 0d 09 09 09 2f 2f 20 |yle scra|p....// |
|00002550| 70 69 6e 20 74 68 65 20 | 65 6e 74 72 79 20 63 6f |pin the |entry co|
|00002560| 75 6e 74 20 61 74 20 33 | 32 2c 37 36 37 0d 09 09 |unt at 3|2,767...|
|00002570| 09 28 2a 20 28 54 45 53 | 74 79 6c 65 53 63 72 61 |.(* (TES|tyleScra|
|00002580| 70 48 61 6e 64 6c 65 29 | 20 68 53 74 79 6c 65 73 |pHandle)| hStyles|
|00002590| 29 2d 3e 73 63 72 70 4e | 53 74 79 6c 65 73 20 3d |)->scrpN|Styles =|
|000025a0| 20 28 6e 52 75 6e 73 20 | 3c 20 53 48 52 54 5f 4d | (nRuns |< SHRT_M|
|000025b0| 41 58 29 20 3f 20 6e 52 | 75 6e 73 20 3a 20 53 48 |AX) ? nR|uns : SH|
|000025c0| 52 54 5f 4d 41 58 3b 0d | 0d 09 09 09 2f 2f 20 67 |RT_MAX;.|....// g|
|000025d0| 65 74 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 66 69 |et point|er to fi|
|000025e0| 72 73 74 20 73 74 79 6c | 65 20 74 61 62 6c 65 20 |rst styl|e table |
|000025f0| 65 6c 65 6d 65 6e 74 0d | 09 09 09 70 45 6e 74 72 |element.|...pEntr|
|00002600| 79 20 3d 20 26 20 28 28 | 2a 20 28 54 45 53 74 79 |y = & ((|* (TESty|
|00002610| 6c 65 53 63 72 61 70 48 | 61 6e 64 6c 65 29 20 68 |leScrapH|andle) h|
|00002620| 53 74 79 6c 65 73 29 2d | 3e 73 63 72 70 53 74 79 |Styles)-|>scrpSty|
|00002630| 6c 65 54 61 62 5b 30 5d | 29 3b 0d 09 09 7d 0d 0d |leTab[0]|);...}..|
|00002640| 09 09 2f 2f 20 6c 6f 6f | 70 20 74 68 72 6f 75 67 |..// loo|p throug|
|00002650| 68 20 65 76 65 72 79 20 | 73 74 79 6c 65 20 72 75 |h every |style ru|
|00002660| 6e 20 69 6e 20 74 68 65 | 20 73 65 6c 65 63 74 69 |n in the| selecti|
|00002670| 6f 6e 20 72 61 6e 67 65 | 0d 09 09 66 6f 72 20 28 |on range|...for (|
|00002680| 20 69 20 3d 20 30 3b 20 | 69 20 3c 20 6e 52 75 6e | i = 0; |i < nRun|
|00002690| 73 3b 20 69 2b 2b 20 29 | 0d 09 09 7b 0d 09 09 09 |s; i++ )|...{....|
|000026a0| 5f 57 45 47 65 74 49 6e | 64 53 74 79 6c 65 28 66 |_WEGetIn|dStyle(f|
|000026b0| 69 72 73 74 52 75 6e 20 | 2b 20 69 2c 20 26 69 6e |irstRun |+ i, &in|
|000026c0| 66 6f 2c 20 68 57 45 29 | 3b 0d 0d 09 09 09 2f 2f |fo, hWE)|;.....//|
|000026d0| 20 63 61 6c 63 75 6c 61 | 74 65 20 74 68 65 20 73 | calcula|te the s|
|000026e0| 74 61 72 74 20 63 68 61 | 72 61 63 74 65 72 20 66 |tart cha|racter f|
|000026f0| 6f 72 20 74 68 69 73 20 | 73 74 79 6c 65 20 72 75 |or this |style ru|
|00002700| 6e 2c 20 72 65 6c 61 74 | 69 76 65 20 74 6f 20 74 |n, relat|ive to t|
|00002710| 68 65 20 62 65 67 69 6e | 6e 69 6e 67 20 6f 66 20 |he begin|ning of |
|00002720| 74 68 65 20 72 61 6e 67 | 65 0d 09 09 09 73 74 61 |the rang|e....sta|
|00002730| 72 74 43 68 61 72 20 3d | 20 69 6e 66 6f 2e 72 75 |rtChar =| info.ru|
|00002740| 6e 53 74 61 72 74 20 2d | 20 72 61 6e 67 65 53 74 |nStart -| rangeSt|
|00002750| 61 72 74 3b 0d 09 09 09 | 69 66 20 28 73 74 61 72 |art;....|if (star|
|00002760| 74 43 68 61 72 20 3c 20 | 30 29 0d 09 09 09 7b 0d |tChar < |0)....{.|
|00002770| 09 09 09 09 73 74 61 72 | 74 43 68 61 72 20 3d 20 |....star|tChar = |
|00002780| 30 3b 0d 23 69 66 20 57 | 41 53 54 45 5f 4f 42 4a |0;.#if W|ASTE_OBJ|
|00002790| 45 43 54 53 0d 09 09 09 | 09 69 6e 66 6f 2e 72 75 |ECTS....|.info.ru|
|000027a0| 6e 41 74 74 72 73 2e 72 | 75 6e 53 74 79 6c 65 2e |nAttrs.r|unStyle.|
|000027b0| 74 73 53 74 79 6c 65 72 | 20 3d 20 6e 69 6c 3b 0d |tsStyler| = nil;.|
|000027c0| 09 09 09 09 69 6e 66 6f | 2e 72 75 6e 41 74 74 72 |....info|.runAttr|
|000027d0| 73 2e 72 75 6e 53 74 79 | 6c 65 2e 74 73 4f 62 6a |s.runSty|le.tsObj|
|000027e0| 65 63 74 20 3d 20 6e 69 | 6c 3b 0d 23 65 6e 64 69 |ect = ni|l;.#endi|
|000027f0| 66 0d 09 09 09 7d 0d 09 | 09 09 69 66 20 28 68 53 |f....}..|..if (hS|
|00002800| 74 79 6c 65 73 20 21 3d | 20 6e 69 6c 29 0d 09 09 |tyles !=| nil)...|
|00002810| 09 7b 0d 09 09 09 09 69 | 6e 66 6f 2e 72 75 6e 41 |.{.....i|nfo.runA|
|00002820| 74 74 72 73 2e 72 75 6e | 53 74 79 6c 65 2e 74 73 |ttrs.run|Style.ts|
|00002830| 46 6c 61 67 73 20 3d 20 | 30 3b 20 2f 2f 20 64 6f |Flags = |0; // do|
|00002840| 6e 27 74 20 65 78 70 6f | 72 74 20 69 6e 74 65 72 |n't expo|rt inter|
|00002850| 6e 61 6c 20 66 6c 61 67 | 73 0d 09 09 09 09 70 45 |nal flag|s.....pE|
|00002860| 6e 74 72 79 2d 3e 73 63 | 72 70 53 74 61 72 74 43 |ntry->sc|rpStartC|
|00002870| 68 61 72 20 3d 20 73 74 | 61 72 74 43 68 61 72 3b |har = st|artChar;|
|00002880| 0d 09 09 09 09 70 45 6e | 74 72 79 2d 3e 73 63 72 |.....pEn|try->scr|
|00002890| 70 54 45 41 74 74 72 73 | 20 3d 20 2a 20 28 54 45 |pTEAttrs| = * (TE|
|000028a0| 52 75 6e 41 74 74 72 69 | 62 75 74 65 73 20 2a 29 |RunAttri|butes *)|
|000028b0| 20 26 69 6e 66 6f 2e 72 | 75 6e 41 74 74 72 73 3b | &info.r|unAttrs;|
|000028c0| 0d 09 09 09 09 70 45 6e | 74 72 79 2b 2b 3b 0d 09 |.....pEn|try++;..|
|000028d0| 09 09 7d 0d 0d 23 69 66 | 20 57 41 53 54 45 5f 4f |..}..#if| WASTE_O|
|000028e0| 42 4a 45 43 54 53 0d 09 | 09 09 69 66 20 28 68 53 |BJECTS..|..if (hS|
|000028f0| 6f 75 70 20 21 3d 20 6e | 69 6c 29 0d 09 09 09 7b |oup != n|il)....{|
|00002900| 0d 09 09 09 09 2f 2f 20 | 69 66 20 74 68 69 73 20 |.....// |if this |
|00002910| 73 74 79 6c 65 20 72 75 | 6e 20 72 65 66 65 72 65 |style ru|n refere|
|00002920| 6e 63 65 73 20 61 6e 20 | 65 6d 62 65 64 64 65 64 |nces an |embedded|
|00002930| 20 6f 62 6a 65 63 74 2c | 20 61 70 70 65 6e 64 20 | object,| append |
|00002940| 69 74 20 74 6f 20 74 68 | 65 20 22 73 6f 75 70 22 |it to th|e "soup"|
|00002950| 0d 09 09 09 09 69 66 20 | 28 28 69 6e 66 6f 2e 72 |.....if |((info.r|
|00002960| 75 6e 41 74 74 72 73 2e | 72 75 6e 53 74 79 6c 65 |unAttrs.|runStyle|
|00002970| 2e 74 73 53 74 79 6c 65 | 72 20 21 3d 20 6e 69 6c |.tsStyle|r != nil|
|00002980| 29 20 7c 7c 0d 09 09 09 | 09 09 28 69 6e 66 6f 2e |) ||....|..(info.|
|00002990| 72 75 6e 41 74 74 72 73 | 2e 72 75 6e 53 74 79 6c |runAttrs|.runStyl|
|000029a0| 65 2e 74 73 4f 62 6a 65 | 63 74 20 21 3d 20 6e 69 |e.tsObje|ct != ni|
|000029b0| 6c 29 29 0d 09 09 09 09 | 7b 0d 09 09 09 09 09 69 |l)).....|{......i|
|000029c0| 66 20 28 28 65 72 72 20 | 3d 20 5f 57 45 41 70 70 |f ((err |= _WEApp|
|000029d0| 65 6e 64 4f 62 6a 65 63 | 74 28 68 53 6f 75 70 2c |endObjec|t(hSoup,|
|000029e0| 20 26 69 6e 66 6f 2c 20 | 73 74 61 72 74 43 68 61 | &info, |startCha|
|000029f0| 72 29 29 20 21 3d 20 6e | 6f 45 72 72 29 0d 09 09 |r)) != n|oErr)...|
|00002a00| 09 09 09 7b 0d 09 09 09 | 09 09 09 67 6f 74 6f 20 |...{....|...goto |
|00002a10| 63 6c 65 61 6e 75 70 3b | 0d 09 09 09 09 09 7d 0d |cleanup;|......}.|
|00002a20| 09 09 09 09 7d 0d 09 09 | 09 7d 0d 23 65 6e 64 69 |....}...|.}.#endi|
|00002a30| 66 0d 0d 09 09 7d 0d 09 | 7d 0d 09 2f 2f 20 63 6c |f....}..|}..// cl|
|00002a40| 65 61 72 20 72 65 73 75 | 6c 74 20 63 6f 64 65 0d |ear resu|lt code.|
|00002a50| 09 65 72 72 20 3d 20 6e | 6f 45 72 72 3b 0d 0d 63 |.err = n|oErr;..c|
|00002a60| 6c 65 61 6e 75 70 3a 0d | 0d 09 2f 2f 20 75 6e 6c |leanup:.|..// unl|
|00002a70| 6f 63 6b 20 74 68 65 20 | 73 74 79 6c 65 20 73 63 |ock the |style sc|
|00002a80| 72 61 70 20 68 61 6e 64 | 6c 65 0d 09 69 66 20 28 |rap hand|le..if (|
|00002a90| 68 53 74 79 6c 65 73 20 | 21 3d 20 6e 69 6c 29 0d |hStyles |!= nil).|
|00002aa0| 09 7b 0d 09 09 48 55 6e | 6c 6f 63 6b 28 28 48 61 |.{...HUn|lock((Ha|
|00002ab0| 6e 64 6c 65 29 68 53 74 | 79 6c 65 73 29 3b 0d 09 |ndle)hSt|yles);..|
|00002ac0| 7d 0d 0d 09 2f 2f 20 75 | 6e 6c 6f 63 6b 20 74 68 |}...// u|nlock th|
|00002ad0| 65 20 57 45 20 72 65 63 | 6f 72 64 0d 09 5f 57 45 |e WE rec|ord.._WE|
|00002ae0| 53 65 74 48 61 6e 64 6c | 65 4c 6f 63 6b 28 28 48 |SetHandl|eLock((H|
|00002af0| 61 6e 64 6c 65 29 20 68 | 57 45 2c 20 73 61 76 65 |andle) h|WE, save|
|00002b00| 57 45 4c 6f 63 6b 29 3b | 0d 09 2f 2f 20 72 65 74 |WELock);|..// ret|
|00002b10| 75 72 6e 20 72 65 73 75 | 6c 74 20 63 6f 64 65 0d |urn resu|lt code.|
|00002b20| 09 72 65 74 75 72 6e 20 | 65 72 72 3b 0d 7d 0d 0d |.return |err;.}..|
|00002b30| 70 61 73 63 61 6c 20 4f | 53 45 72 72 20 5f 57 45 |pascal O|SErr _WE|
|00002b40| 50 75 74 53 63 72 61 70 | 48 61 6e 64 6c 65 20 28 |PutScrap|Handle (|
|00002b50| 20 46 6c 61 76 6f 72 54 | 79 70 65 20 64 61 74 61 | FlavorT|ype data|
|00002b60| 46 6c 61 76 6f 72 2c 20 | 48 61 6e 64 6c 65 20 64 |Flavor, |Handle d|
|00002b70| 61 74 61 48 61 6e 64 6c | 65 20 29 0d 7b 0d 09 42 |ataHandl|e ).{..B|
|00002b80| 6f 6f 6c 65 61 6e 20 73 | 61 76 65 44 61 74 61 4c |oolean s|aveDataL|
|00002b90| 6f 63 6b 20 3b 0d 09 4f | 53 45 72 72 20 65 72 72 |ock ;..O|SErr err|
|00002ba0| 20 3b 0d 0d 09 73 61 76 | 65 44 61 74 61 4c 6f 63 | ;...sav|eDataLoc|
|00002bb0| 6b 20 3d 20 5f 57 45 53 | 65 74 48 61 6e 64 6c 65 |k = _WES|etHandle|
|00002bc0| 4c 6f 63 6b 20 28 20 64 | 61 74 61 48 61 6e 64 6c |Lock ( d|ataHandl|
|00002bd0| 65 2c 20 74 72 75 65 20 | 29 20 3b 0d 23 69 66 20 |e, true |) ;.#if |
|00002be0| 54 41 52 47 45 54 5f 43 | 41 52 42 4f 4e 0d 09 7b |TARGET_C|ARBON..{|
|00002bf0| 0d 09 09 53 63 72 61 70 | 52 65 66 20 73 63 72 61 |...Scrap|Ref scra|
|00002c00| 70 3b 0d 09 09 65 72 72 | 20 3d 20 47 65 74 43 75 |p;...err| = GetCu|
|00002c10| 72 72 65 6e 74 53 63 72 | 61 70 28 20 26 73 63 72 |rrentScr|ap( &scr|
|00002c20| 61 70 20 29 3b 0d 09 09 | 69 66 20 28 65 72 72 20 |ap );...|if (err |
|00002c30| 3d 3d 20 6e 6f 45 72 72 | 29 0d 09 09 7b 0d 09 09 |== noErr|)...{...|
|00002c40| 09 65 72 72 20 3d 20 50 | 75 74 53 63 72 61 70 46 |.err = P|utScrapF|
|00002c50| 6c 61 76 6f 72 28 73 63 | 72 61 70 2c 20 64 61 74 |lavor(sc|rap, dat|
|00002c60| 61 46 6c 61 76 6f 72 2c | 20 6b 53 63 72 61 70 46 |aFlavor,| kScrapF|
|00002c70| 6c 61 76 6f 72 4d 61 73 | 6b 4e 6f 6e 65 2c 20 0d |lavorMas|kNone, .|
|00002c80| 09 09 09 09 09 09 09 09 | 20 47 65 74 48 61 6e 64 |........| GetHand|
|00002c90| 6c 65 53 69 7a 65 20 28 | 20 64 61 74 61 48 61 6e |leSize (| dataHan|
|00002ca0| 64 6c 65 20 29 2c 20 2a | 20 64 61 74 61 48 61 6e |dle ), *| dataHan|
|00002cb0| 64 6c 65 29 3b 0d 09 09 | 7d 0d 09 7d 0d 23 65 6c |dle);...|}..}.#el|
|00002cc0| 73 65 0d 09 65 72 72 20 | 3d 20 50 75 74 53 63 72 |se..err |= PutScr|
|00002cd0| 61 70 20 28 20 47 65 74 | 48 61 6e 64 6c 65 53 69 |ap ( Get|HandleSi|
|00002ce0| 7a 65 20 28 20 64 61 74 | 61 48 61 6e 64 6c 65 20 |ze ( dat|aHandle |
|00002cf0| 29 2c 20 64 61 74 61 46 | 6c 61 76 6f 72 2c 20 2a |), dataF|lavor, *|
|00002d00| 20 64 61 74 61 48 61 6e | 64 6c 65 20 29 20 3b 0d | dataHan|dle ) ;.|
|00002d10| 23 65 6e 64 69 66 0d 09 | 5f 57 45 53 65 74 48 61 |#endif..|_WESetHa|
|00002d20| 6e 64 6c 65 4c 6f 63 6b | 20 28 20 64 61 74 61 48 |ndleLock| ( dataH|
|00002d30| 61 6e 64 6c 65 2c 20 73 | 61 76 65 44 61 74 61 4c |andle, s|aveDataL|
|00002d40| 6f 63 6b 20 29 20 3b 0d | 0d 09 72 65 74 75 72 6e |ock ) ;.|..return|
|00002d50| 20 65 72 72 20 3b 0d 7d | 0d 0d 70 61 73 63 61 6c | err ;.}|..pascal|
|00002d60| 20 4f 53 45 72 72 20 57 | 45 43 6f 70 79 20 28 20 | OSErr W|ECopy ( |
|00002d70| 57 45 48 61 6e 64 6c 65 | 20 68 57 45 20 29 0d 7b |WEHandle| hWE ).{|
|00002d80| 0d 09 2f 2f 09 63 6f 70 | 79 20 74 68 65 20 73 65 |..//.cop|y the se|
|00002d90| 6c 65 63 74 69 6f 6e 20 | 72 61 6e 67 65 20 74 6f |lection |range to|
|00002da0| 20 74 68 65 20 64 65 73 | 6b 20 73 63 72 61 70 0d | the des|k scrap.|
|00002db0| 0d 09 57 45 50 74 72 20 | 70 57 45 20 3b 0d 09 48 |..WEPtr |pWE ;..H|
|00002dc0| 61 6e 64 6c 65 20 64 61 | 74 61 48 61 6e 64 6c 65 |andle da|taHandle|
|00002dd0| 20 3d 20 6e 69 6c 20 3b | 0d 09 42 6f 6f 6c 65 61 | = nil ;|..Boolea|
|00002de0| 6e 20 73 61 76 65 57 45 | 4c 6f 63 6b 3b 0d 09 4f |n saveWE|Lock;..O|
|00002df0| 53 45 72 72 20 65 72 72 | 3b 0d 23 69 66 20 57 41 |SErr err|;.#if WA|
|00002e00| 53 54 45 5f 4f 42 4a 45 | 43 54 53 0d 09 57 45 4f |STE_OBJE|CTS..WEO|
|00002e10| 62 6a 65 63 74 44 65 73 | 63 48 61 6e 64 6c 65 20 |bjectDes|cHandle |
|00002e20| 68 4f 62 6a 65 63 74 44 | 65 73 63 20 3d 20 6e 69 |hObjectD|esc = ni|
|00002e30| 6c 3b 0d 23 65 6e 64 69 | 66 0d 0d 09 2f 2f 09 6c |l;.#endi|f...//.l|
|00002e40| 6f 63 6b 20 74 68 65 20 | 57 45 20 72 65 63 6f 72 |ock the |WE recor|
|00002e50| 64 0d 09 73 61 76 65 57 | 45 4c 6f 63 6b 20 3d 20 |d..saveW|ELock = |
|00002e60| 5f 57 45 53 65 74 48 61 | 6e 64 6c 65 4c 6f 63 6b |_WESetHa|ndleLock|
|00002e70| 20 28 20 28 20 48 61 6e | 64 6c 65 20 29 20 68 57 | ( ( Han|dle ) hW|
|00002e80| 45 2c 20 74 72 75 65 20 | 29 20 3b 0d 09 70 57 45 |E, true |) ;..pWE|
|00002e90| 20 3d 20 2a 20 68 57 45 | 20 3b 0d 0d 09 2f 2f 09 | = * hWE| ;...//.|
|00002ea0| 72 65 74 75 72 6e 20 77 | 65 45 6d 70 74 79 53 65 |return w|eEmptySe|
|00002eb0| 6c 65 63 74 69 6f 6e 45 | 72 72 20 69 66 20 74 68 |lectionE|rr if th|
|00002ec0| 65 20 73 65 6c 65 63 74 | 69 6f 6e 20 72 61 6e 67 |e select|ion rang|
|00002ed0| 65 20 69 73 20 65 6d 70 | 74 79 0d 09 65 72 72 20 |e is emp|ty..err |
|00002ee0| 3d 20 77 65 45 6d 70 74 | 79 53 65 6c 65 63 74 69 |= weEmpt|ySelecti|
|00002ef0| 6f 6e 45 72 72 20 3b 0d | 09 69 66 20 28 20 70 57 |onErr ;.|.if ( pW|
|00002f00| 45 20 2d 3e 20 73 65 6c | 53 74 61 72 74 20 3d 3d |E -> sel|Start ==|
|00002f10| 20 70 57 45 20 2d 3e 20 | 73 65 6c 45 6e 64 20 29 | pWE -> |selEnd )|
|00002f20| 0d 09 7b 0d 09 09 67 6f | 74 6f 20 63 6c 65 61 6e |..{...go|to clean|
|00002f30| 75 70 20 3b 0d 09 7d 0d | 0d 09 2f 2f 09 63 6c 65 |up ;..}.|..//.cle|
|00002f40| 61 72 20 74 68 65 20 64 | 65 73 6b 20 73 63 72 61 |ar the d|esk scra|
|00002f50| 70 0d 23 69 66 20 54 41 | 52 47 45 54 5f 43 41 52 |p.#if TA|RGET_CAR|
|00002f60| 42 4f 4e 0d 09 65 72 72 | 20 3d 20 43 6c 65 61 72 |BON..err| = Clear|
|00002f70| 43 75 72 72 65 6e 74 53 | 63 72 61 70 28 29 3b 0d |CurrentS|crap();.|
|00002f80| 23 65 6c 73 65 0d 09 65 | 72 72 20 3d 20 5a 65 72 |#else..e|rr = Zer|
|00002f90| 6f 53 63 72 61 70 20 28 | 20 29 3b 0d 23 65 6e 64 |oScrap (| );.#end|
|00002fa0| 69 66 0d 09 69 66 20 28 | 20 65 72 72 20 21 3d 20 |if..if (| err != |
|00002fb0| 6e 6f 45 72 72 20 29 0d | 09 7b 0d 09 09 67 6f 74 |noErr ).|.{...got|
|00002fc0| 6f 20 63 6c 65 61 6e 75 | 70 20 3b 0d 09 7d 0d 0d |o cleanu|p ;..}..|
|00002fd0| 09 2f 2f 09 61 6c 6c 6f | 63 61 74 65 20 61 20 74 |.//.allo|cate a t|
|00002fe0| 65 6d 70 6f 72 61 72 79 | 20 68 61 6e 64 6c 65 0d |emporary| handle.|
|00002ff0| 09 69 66 20 28 20 28 20 | 65 72 72 20 3d 20 5f 57 |.if ( ( |err = _W|
|00003000| 45 41 6c 6c 6f 63 61 74 | 65 20 28 20 30 2c 20 6b |EAllocat|e ( 0, k|
|00003010| 41 6c 6c 6f 63 54 65 6d | 70 2c 20 26 20 64 61 74 |AllocTem|p, & dat|
|00003020| 61 48 61 6e 64 6c 65 20 | 29 20 29 20 21 3d 20 6e |aHandle |) ) != n|
|00003030| 6f 45 72 72 20 29 0d 09 | 7b 0d 09 09 67 6f 74 6f |oErr )..|{...goto|
|00003040| 20 63 6c 65 61 6e 75 70 | 20 3b 0d 09 7d 0d 0d 23 | cleanup| ;..}..#|
|00003050| 69 66 20 57 41 53 54 45 | 5f 4f 42 4a 45 43 54 53 |if WASTE|_OBJECTS|
|00003060| 0d 09 2f 2f 09 69 73 20 | 74 68 65 72 65 20 61 20 |..//.is |there a |
|00003070| 73 65 6c 65 63 74 65 64 | 20 6f 62 6a 65 63 74 3f |selected| object?|
|00003080| 0d 09 69 66 20 28 20 57 | 45 47 65 74 53 65 6c 65 |..if ( W|EGetSele|
|00003090| 63 74 65 64 4f 62 6a 65 | 63 74 20 28 20 26 20 68 |ctedObje|ct ( & h|
|000030a0| 4f 62 6a 65 63 74 44 65 | 73 63 2c 20 68 57 45 20 |ObjectDe|sc, hWE |
|000030b0| 29 20 3d 3d 20 6e 6f 45 | 72 72 20 29 0d 09 7b 0d |) == noE|rr )..{.|
|000030c0| 09 09 46 6c 61 76 6f 72 | 54 79 70 65 20 6f 62 6a |..Flavor|Type obj|
|000030d0| 65 63 74 54 79 70 65 20 | 3d 20 30 20 3b 0d 09 09 |ectType |= 0 ;...|
|000030e0| 42 6f 6f 6c 65 61 6e 20 | 64 69 73 70 6f 73 65 44 |Boolean |disposeD|
|000030f0| 61 74 61 20 3d 20 66 61 | 6c 73 65 20 3b 0d 0d 09 |ata = fa|lse ;...|
|00003100| 09 2f 2f 09 73 74 72 65 | 61 6d 20 69 74 0d 09 09 |.//.stre|am it...|
|00003110| 69 66 20 28 20 28 20 65 | 72 72 20 3d 20 5f 57 45 |if ( ( e|rr = _WE|
|00003120| 53 74 72 65 61 6d 4f 62 | 6a 65 63 74 20 28 20 77 |StreamOb|ject ( w|
|00003130| 65 54 6f 53 63 72 61 70 | 2c 20 26 20 6f 62 6a 65 |eToScrap|, & obje|
|00003140| 63 74 54 79 70 65 2c 20 | 26 20 64 61 74 61 48 61 |ctType, |& dataHa|
|00003150| 6e 64 6c 65 2c 0d 09 09 | 09 09 26 20 64 69 73 70 |ndle,...|..& disp|
|00003160| 6f 73 65 44 61 74 61 2c | 20 68 4f 62 6a 65 63 74 |oseData,| hObject|
|00003170| 44 65 73 63 20 29 20 29 | 20 21 3d 20 6e 6f 45 72 |Desc ) )| != noEr|
|00003180| 72 20 29 0d 09 09 7b 0d | 09 09 09 67 6f 74 6f 20 |r )...{.|...goto |
|00003190| 63 6c 65 61 6e 75 70 20 | 3b 0d 09 09 7d 0d 0d 09 |cleanup |;...}...|
|000031a0| 09 2f 2f 09 70 75 74 20 | 69 74 20 6f 6e 20 74 68 |.//.put |it on th|
|000031b0| 65 20 73 63 72 61 70 0d | 09 09 69 66 20 28 20 28 |e scrap.|..if ( (|
|000031c0| 20 65 72 72 20 3d 20 5f | 57 45 50 75 74 53 63 72 | err = _|WEPutScr|
|000031d0| 61 70 48 61 6e 64 6c 65 | 20 28 20 6f 62 6a 65 63 |apHandle| ( objec|
|000031e0| 74 54 79 70 65 2c 20 64 | 61 74 61 48 61 6e 64 6c |tType, d|ataHandl|
|000031f0| 65 20 29 20 29 20 21 3d | 20 6e 6f 45 72 72 20 29 |e ) ) !=| noErr )|
|00003200| 0d 09 09 7b 0d 09 09 09 | 67 6f 74 6f 20 63 6c 65 |...{....|goto cle|
|00003210| 61 6e 75 70 20 3b 0d 09 | 09 7d 0d 0d 09 09 69 66 |anup ;..|.}....if|
|00003220| 20 28 20 21 20 64 69 73 | 70 6f 73 65 44 61 74 61 | ( ! dis|poseData|
|00003230| 20 29 0d 09 09 7b 0d 09 | 09 09 64 61 74 61 48 61 | )...{..|..dataHa|
|00003240| 6e 64 6c 65 20 3d 20 6e | 69 6c 20 3b 0d 09 09 7d |ndle = n|il ;...}|
|00003250| 0d 09 7d 0d 09 65 6c 73 | 65 0d 23 65 6e 64 69 66 |..}..els|e.#endif|
|00003260| 0d 09 7b 0d 09 09 2f 2f | 09 6d 61 6b 65 20 61 20 |..{...//|.make a |
|00003270| 63 6f 70 79 20 6f 66 20 | 74 68 65 20 73 65 6c 65 |copy of |the sele|
|00003280| 63 74 65 64 20 74 65 78 | 74 0d 09 09 69 66 20 28 |cted tex|t...if (|
|00003290| 20 28 20 65 72 72 20 3d | 20 57 45 43 6f 70 79 52 | ( err =| WECopyR|
|000032a0| 61 6e 67 65 20 28 20 70 | 57 45 20 2d 3e 20 73 65 |ange ( p|WE -> se|
|000032b0| 6c 53 74 61 72 74 2c 20 | 70 57 45 20 2d 3e 20 73 |lStart, |pWE -> s|
|000032c0| 65 6c 45 6e 64 2c 20 64 | 61 74 61 48 61 6e 64 6c |elEnd, d|ataHandl|
|000032d0| 65 2c 20 6e 69 6c 2c 20 | 6e 69 6c 2c 20 68 57 45 |e, nil, |nil, hWE|
|000032e0| 20 29 20 29 20 21 3d 20 | 6e 6f 45 72 72 20 29 0d | ) ) != |noErr ).|
|000032f0| 09 09 7b 0d 09 09 09 67 | 6f 74 6f 20 63 6c 65 61 |..{....g|oto clea|
|00003300| 6e 75 70 20 3b 0d 09 09 | 7d 0d 0d 09 09 2f 2f 09 |nup ;...|}....//.|
|00003310| 70 75 74 20 69 74 20 6f | 6e 20 74 68 65 20 73 63 |put it o|n the sc|
|00003320| 72 61 70 0d 09 09 69 66 | 20 28 20 28 20 65 72 72 |rap...if| ( ( err|
|00003330| 20 3d 20 5f 57 45 50 75 | 74 53 63 72 61 70 48 61 | = _WEPu|tScrapHa|
|00003340| 6e 64 6c 65 20 28 20 6b | 54 79 70 65 54 65 78 74 |ndle ( k|TypeText|
|00003350| 2c 20 64 61 74 61 48 61 | 6e 64 6c 65 20 29 20 29 |, dataHa|ndle ) )|
|00003360| 20 21 3d 20 6e 6f 45 72 | 72 20 29 0d 09 09 7b 0d | != noEr|r )...{.|
|00003370| 09 09 09 67 6f 74 6f 20 | 63 6c 65 61 6e 75 70 20 |...goto |cleanup |
|00003380| 3b 0d 09 09 7d 0d 0d 09 | 09 2f 2f 09 64 6f 6e 27 |;...}...|.//.don'|
|00003390| 74 20 63 6f 70 79 20 73 | 74 79 6c 65 73 2f 73 6f |t copy s|tyles/so|
|000033a0| 75 70 20 69 66 20 74 68 | 65 20 74 65 78 74 20 69 |up if th|e text i|
|000033b0| 73 20 6d 6f 6e 6f 73 74 | 79 6c 65 64 0d 09 09 69 |s monost|yled...i|
|000033c0| 66 20 28 20 21 20 42 54 | 53 54 20 28 20 70 57 45 |f ( ! BT|ST ( pWE|
|000033d0| 20 2d 3e 20 66 65 61 74 | 75 72 65 73 2c 20 77 65 | -> feat|ures, we|
|000033e0| 46 4d 6f 6e 6f 53 74 79 | 6c 65 64 20 29 20 29 0d |FMonoSty|led ) ).|
|000033f0| 09 09 7b 0d 09 09 09 2f | 2f 09 62 75 69 6c 64 20 |..{..../|/.build |
|00003400| 26 20 63 6f 70 79 20 61 | 20 73 74 79 6c 65 20 73 |& copy a| style s|
|00003410| 63 72 61 70 0d 09 09 09 | 69 66 20 28 20 28 20 65 |crap....|if ( ( e|
|00003420| 72 72 20 3d 20 57 45 43 | 6f 70 79 52 61 6e 67 65 |rr = WEC|opyRange|
|00003430| 20 28 20 70 57 45 20 2d | 3e 20 73 65 6c 53 74 61 | ( pWE -|> selSta|
|00003440| 72 74 2c 20 70 57 45 20 | 2d 3e 20 73 65 6c 45 6e |rt, pWE |-> selEn|
|00003450| 64 2c 20 6e 69 6c 2c 20 | 28 53 74 53 63 72 70 48 |d, nil, |(StScrpH|
|00003460| 61 6e 64 6c 65 29 64 61 | 74 61 48 61 6e 64 6c 65 |andle)da|taHandle|
|00003470| 2c 20 6e 69 6c 2c 20 68 | 57 45 20 29 20 29 20 21 |, nil, h|WE ) ) !|
|00003480| 3d 20 6e 6f 45 72 72 20 | 29 0d 09 09 09 7b 0d 09 |= noErr |)....{..|
|00003490| 09 09 09 67 6f 74 6f 20 | 63 6c 65 61 6e 75 70 20 |...goto |cleanup |
|000034a0| 3b 0d 09 09 09 7d 0d 09 | 09 09 69 66 20 28 20 28 |;....}..|..if ( (|
|000034b0| 20 65 72 72 20 3d 20 5f | 57 45 50 75 74 53 63 72 | err = _|WEPutScr|
|000034c0| 61 70 48 61 6e 64 6c 65 | 20 28 20 6b 54 79 70 65 |apHandle| ( kType|
|000034d0| 53 74 79 6c 65 73 2c 20 | 64 61 74 61 48 61 6e 64 |Styles, |dataHand|
|000034e0| 6c 65 20 29 20 29 20 21 | 3d 20 6e 6f 45 72 72 20 |le ) ) !|= noErr |
|000034f0| 29 0d 09 09 09 7b 0d 09 | 09 09 09 67 6f 74 6f 20 |)....{..|...goto |
|00003500| 63 6c 65 61 6e 75 70 20 | 3b 0d 09 09 09 7d 0d 0d |cleanup |;....}..|
|00003510| 09 09 09 2f 2f 09 62 75 | 69 6c 64 20 26 20 63 6f |...//.bu|ild & co|
|00003520| 70 79 20 61 20 66 6f 6e | 74 20 74 61 62 6c 65 0d |py a fon|t table.|
|00003530| 09 09 09 69 66 20 28 20 | 28 20 65 72 72 20 3d 20 |...if ( |( err = |
|00003540| 57 45 42 75 69 6c 64 46 | 6f 6e 74 54 61 62 6c 65 |WEBuildF|ontTable|
|00003550| 20 28 20 28 57 45 46 6f | 6e 74 54 61 62 6c 65 48 | ( (WEFo|ntTableH|
|00003560| 61 6e 64 6c 65 29 64 61 | 74 61 48 61 6e 64 6c 65 |andle)da|taHandle|
|00003570| 2c 20 6e 69 6c 2c 20 68 | 57 45 20 29 20 29 20 21 |, nil, h|WE ) ) !|
|00003580| 3d 20 6e 6f 45 72 72 20 | 29 0d 09 09 09 7b 0d 09 |= noErr |)....{..|
|00003590| 09 09 09 67 6f 74 6f 20 | 63 6c 65 61 6e 75 70 20 |...goto |cleanup |
|000035a0| 3b 0d 09 09 09 7d 0d 09 | 09 09 69 66 20 28 20 28 |;....}..|..if ( (|
|000035b0| 20 65 72 72 20 3d 20 5f | 57 45 50 75 74 53 63 72 | err = _|WEPutScr|
|000035c0| 61 70 48 61 6e 64 6c 65 | 20 28 20 6b 54 79 70 65 |apHandle| ( kType|
|000035d0| 46 6f 6e 74 54 61 62 6c | 65 2c 20 64 61 74 61 48 |FontTabl|e, dataH|
|000035e0| 61 6e 64 6c 65 20 29 20 | 29 20 21 3d 20 6e 6f 45 |andle ) |) != noE|
|000035f0| 72 72 20 29 0d 09 09 09 | 7b 0d 09 09 09 09 67 6f |rr )....|{.....go|
|00003600| 74 6f 20 63 6c 65 61 6e | 75 70 20 3b 0d 09 09 09 |to clean|up ;....|
|00003610| 7d 0d 0d 23 69 66 20 57 | 41 53 54 45 5f 4f 42 4a |}..#if W|ASTE_OBJ|
|00003620| 45 43 54 53 0d 09 09 09 | 2f 2f 09 62 75 69 6c 64 |ECTS....|//.build|
|00003630| 20 26 20 63 6f 70 79 20 | 61 6e 20 6f 62 6a 65 63 | & copy |an objec|
|00003640| 74 20 73 6f 75 70 0d 09 | 09 09 69 66 20 28 20 28 |t soup..|..if ( (|
|00003650| 20 65 72 72 20 3d 20 57 | 45 43 6f 70 79 52 61 6e | err = W|ECopyRan|
|00003660| 67 65 20 28 20 70 57 45 | 20 2d 3e 20 73 65 6c 53 |ge ( pWE| -> selS|
|00003670| 74 61 72 74 2c 20 70 57 | 45 20 2d 3e 20 73 65 6c |tart, pW|E -> sel|
|00003680| 45 6e 64 2c 20 6e 69 6c | 2c 20 6e 69 6c 2c 20 64 |End, nil|, nil, d|
|00003690| 61 74 61 48 61 6e 64 6c | 65 2c 20 68 57 45 20 29 |ataHandl|e, hWE )|
|000036a0| 20 29 20 21 3d 20 6e 6f | 45 72 72 20 29 0d 09 09 | ) != no|Err )...|
|000036b0| 09 7b 0d 09 09 09 09 67 | 6f 74 6f 20 63 6c 65 61 |.{.....g|oto clea|
|000036c0| 6e 75 70 20 3b 0d 09 09 | 09 7d 0d 09 09 09 69 66 |nup ;...|.}....if|
|000036d0| 20 28 20 28 20 65 72 72 | 20 3d 20 5f 57 45 50 75 | ( ( err| = _WEPu|
|000036e0| 74 53 63 72 61 70 48 61 | 6e 64 6c 65 20 28 20 6b |tScrapHa|ndle ( k|
|000036f0| 54 79 70 65 53 6f 75 70 | 2c 20 64 61 74 61 48 61 |TypeSoup|, dataHa|
|00003700| 6e 64 6c 65 20 29 20 29 | 20 21 3d 20 6e 6f 45 72 |ndle ) )| != noEr|
|00003710| 72 20 29 0d 09 09 09 7b | 0d 09 09 09 09 67 6f 74 |r )....{|.....got|
|00003720| 6f 20 63 6c 65 61 6e 75 | 70 20 3b 0d 09 09 09 7d |o cleanu|p ;....}|
|00003730| 0d 23 65 6e 64 69 66 0d | 09 09 7d 0d 09 7d 0d 0d |.#endif.|..}..}..|
|00003740| 09 2f 2f 09 63 6c 65 61 | 72 20 72 65 73 75 6c 74 |.//.clea|r result|
|00003750| 20 63 6f 64 65 0d 09 65 | 72 72 20 3d 20 6e 6f 45 | code..e|rr = noE|
|00003760| 72 72 3b 0d 0d 63 6c 65 | 61 6e 75 70 3a 0d 09 2f |rr;..cle|anup:../|
|00003770| 2f 09 63 6c 65 61 6e 20 | 75 70 0d 09 5f 57 45 46 |/.clean |up.._WEF|
|00003780| 6f 72 67 65 74 48 61 6e | 64 6c 65 20 28 20 26 20 |orgetHan|dle ( & |
|00003790| 64 61 74 61 48 61 6e 64 | 6c 65 20 29 20 3b 0d 09 |dataHand|le ) ;..|
|000037a0| 5f 57 45 53 65 74 48 61 | 6e 64 6c 65 4c 6f 63 6b |_WESetHa|ndleLock|
|000037b0| 20 28 20 28 20 48 61 6e | 64 6c 65 20 29 20 68 57 | ( ( Han|dle ) hW|
|000037c0| 45 2c 20 73 61 76 65 57 | 45 4c 6f 63 6b 20 29 20 |E, saveW|ELock ) |
|000037d0| 3b 0d 0d 09 2f 2f 09 72 | 65 74 75 72 6e 20 72 65 |;...//.r|eturn re|
|000037e0| 73 75 6c 74 20 63 6f 64 | 65 0d 09 72 65 74 75 72 |sult cod|e..retur|
|000037f0| 6e 20 65 72 72 20 3b 0d | 7d 0d 0d 0d 70 61 73 63 |n err ;.|}...pasc|
|00003800| 61 6c 20 53 74 53 63 72 | 70 48 61 6e 64 6c 65 20 |al StScr|pHandle |
|00003810| 57 45 47 65 74 53 74 79 | 6c 65 53 63 72 61 70 48 |WEGetSty|leScrapH|
|00003820| 61 6e 64 6c 65 28 57 45 | 48 61 6e 64 6c 65 20 68 |andle(WE|Handle h|
|00003830| 57 45 29 0d 7b 0d 09 4f | 53 45 72 72 20 65 72 72 |WE).{..O|SErr err|
|00003840| 20 3d 20 6e 6f 45 72 72 | 3b 0d 09 53 74 53 63 72 | = noErr|;..StScr|
|00003850| 70 48 61 6e 64 6c 65 20 | 68 53 74 79 6c 65 73 20 |pHandle |hStyles |
|00003860| 3d 20 28 53 74 53 63 72 | 70 48 61 6e 64 6c 65 29 |= (StScr|pHandle)|
|00003870| 20 4e 65 77 48 61 6e 64 | 6c 65 28 30 29 3b 0d 09 | NewHand|le(0);..|
|00003880| 69 66 20 28 21 68 53 74 | 79 6c 65 73 29 0d 09 7b |if (!hSt|yles)..{|
|00003890| 0d 09 09 65 72 72 20 3d | 20 4d 65 6d 45 72 72 6f |...err =| MemErro|
|000038a0| 72 28 29 3b 0d 09 09 69 | 66 20 28 21 65 72 72 29 |r();...i|f (!err)|
|000038b0| 0d 09 09 09 65 72 72 20 | 3d 20 6d 65 6d 46 75 6c |....err |= memFul|
|000038c0| 6c 45 72 72 3b 0d 09 7d | 0d 09 65 6c 73 65 0d 09 |lErr;..}|..else..|
|000038d0| 7b 0d 09 09 65 72 72 20 | 3d 20 57 45 43 6f 70 79 |{...err |= WECopy|
|000038e0| 52 61 6e 67 65 28 28 2a | 68 57 45 29 2d 3e 73 65 |Range((*|hWE)->se|
|000038f0| 6c 53 74 61 72 74 2c 20 | 28 2a 68 57 45 29 2d 3e |lStart, |(*hWE)->|
|00003900| 73 65 6c 45 6e 64 2c 20 | 4e 55 4c 4c 2c 20 68 53 |selEnd, |NULL, hS|
|00003910| 74 79 6c 65 73 2c 20 4e | 55 4c 4c 2c 20 68 57 45 |tyles, N|ULL, hWE|
|00003920| 29 3b 0d 23 69 66 20 57 | 41 53 54 45 5f 53 43 41 |);.#if W|ASTE_SCA|
|00003930| 4c 45 0d 09 09 69 66 20 | 28 21 65 72 72 29 0d 09 |LE...if |(!err)..|
|00003940| 09 7b 0d 09 09 09 73 68 | 6f 72 74 20 69 6e 64 65 |.{....sh|ort inde|
|00003950| 78 3b 0d 09 09 09 42 6f | 6f 6c 65 61 6e 20 68 53 |x;....Bo|olean hS|
|00003960| 74 79 6c 65 73 4c 6f 63 | 6b 65 64 3b 0d 09 09 09 |tylesLoc|ked;....|
|00003970| 73 68 6f 72 74 20 73 63 | 72 70 4e 53 74 79 6c 65 |short sc|rpNStyle|
|00003980| 73 20 3d 20 28 2a 68 53 | 74 79 6c 65 73 29 2d 3e |s = (*hS|tyles)->|
|00003990| 73 63 72 70 4e 53 74 79 | 6c 65 73 3b 0d 0d 09 09 |scrpNSty|les;....|
|000039a0| 09 68 53 74 79 6c 65 73 | 4c 6f 63 6b 65 64 20 3d |.hStyles|Locked =|
|000039b0| 20 5f 57 45 53 65 74 48 | 61 6e 64 6c 65 4c 6f 63 | _WESetH|andleLoc|
|000039c0| 6b 28 28 48 61 6e 64 6c | 65 29 68 53 74 79 6c 65 |k((Handl|e)hStyle|
|000039d0| 73 2c 20 74 72 75 65 29 | 3b 0d 09 09 09 0d 09 09 |s, true)|;.......|
|000039e0| 09 66 6f 72 20 28 69 6e | 64 65 78 20 3d 20 30 3b |.for (in|dex = 0;|
|000039f0| 20 69 6e 64 65 78 20 3c | 20 73 63 72 70 4e 53 74 | index <| scrpNSt|
|00003a00| 79 6c 65 73 3b 20 2b 2b | 69 6e 64 65 78 29 0d 09 |yles; ++|index)..|
|00003a10| 09 09 7b 0d 09 09 09 09 | 57 45 52 75 6e 41 74 74 |..{.....|WERunAtt|
|00003a20| 72 69 62 75 74 65 73 20 | 69 6e 66 6f 3b 0d 0d 09 |ributes |info;...|
|00003a30| 09 09 09 53 63 72 70 53 | 54 45 6c 65 6d 65 6e 74 |...ScrpS|TElement|
|00003a40| 2a 20 65 6c 65 6d 65 6e | 74 20 3d 20 26 28 2a 68 |* elemen|t = &(*h|
|00003a50| 53 74 79 6c 65 73 29 2d | 3e 73 63 72 70 53 74 79 |Styles)-|>scrpSty|
|00003a60| 6c 65 54 61 62 5b 69 6e | 64 65 78 5d 3b 0d 09 09 |leTab[in|dex];...|
|00003a70| 09 09 0d 09 09 09 09 69 | 6e 66 6f 2e 72 75 6e 48 |.......i|nfo.runH|
|00003a80| 65 69 67 68 74 20 3d 20 | 65 6c 65 6d 65 6e 74 2d |eight = |element-|
|00003a90| 3e 73 63 72 70 48 65 69 | 67 68 74 3b 0d 09 09 09 |>scrpHei|ght;....|
|00003aa0| 09 69 6e 66 6f 2e 72 75 | 6e 41 73 63 65 6e 74 20 |.info.ru|nAscent |
|00003ab0| 3d 20 65 6c 65 6d 65 6e | 74 2d 3e 73 63 72 70 41 |= elemen|t->scrpA|
|00003ac0| 73 63 65 6e 74 3b 0d 09 | 09 09 09 69 6e 66 6f 2e |scent;..|...info.|
|00003ad0| 72 75 6e 53 74 79 6c 65 | 2e 74 73 46 6f 6e 74 20 |runStyle|.tsFont |
|00003ae0| 3d 20 65 6c 65 6d 65 6e | 74 2d 3e 73 63 72 70 46 |= elemen|t->scrpF|
|00003af0| 6f 6e 74 3b 0d 09 09 09 | 09 69 6e 66 6f 2e 72 75 |ont;....|.info.ru|
|00003b00| 6e 53 74 79 6c 65 2e 74 | 73 46 61 63 65 20 3d 20 |nStyle.t|sFace = |
|00003b10| 65 6c 65 6d 65 6e 74 2d | 3e 73 63 72 70 46 61 63 |element-|>scrpFac|
|00003b20| 65 3b 0d 09 09 09 09 69 | 6e 66 6f 2e 72 75 6e 53 |e;.....i|nfo.runS|
|00003b30| 74 79 6c 65 2e 74 73 46 | 6c 61 67 73 20 3d 20 30 |tyle.tsF|lags = 0|
|00003b40| 3b 0d 09 09 09 09 69 6e | 66 6f 2e 72 75 6e 53 74 |;.....in|fo.runSt|
|00003b50| 79 6c 65 2e 74 73 53 69 | 7a 65 20 3d 20 65 6c 65 |yle.tsSi|ze = ele|
|00003b60| 6d 65 6e 74 2d 3e 73 63 | 72 70 53 69 7a 65 3b 0d |ment->sc|rpSize;.|
|00003b70| 09 09 09 09 69 6e 66 6f | 2e 72 75 6e 53 74 79 6c |....info|.runStyl|
|00003b80| 65 2e 74 73 43 6f 6c 6f | 72 20 3d 20 65 6c 65 6d |e.tsColo|r = elem|
|00003b90| 65 6e 74 2d 3e 73 63 72 | 70 43 6f 6c 6f 72 3b 0d |ent->scr|pColor;.|
|00003ba0| 23 69 66 20 57 41 53 54 | 45 5f 4f 42 4a 45 43 54 |#if WAST|E_OBJECT|
|00003bb0| 53 0d 09 09 09 09 69 6e | 66 6f 2e 72 75 6e 53 74 |S.....in|fo.runSt|
|00003bc0| 79 6c 65 2e 74 73 53 74 | 79 6c 65 72 20 3d 20 4e |yle.tsSt|yler = N|
|00003bd0| 55 4c 4c 3b 0d 09 09 09 | 09 69 6e 66 6f 2e 72 75 |ULL;....|.info.ru|
|00003be0| 6e 53 74 79 6c 65 2e 74 | 73 4f 62 6a 65 63 74 20 |nStyle.t|sObject |
|00003bf0| 3d 20 4e 55 4c 4c 3b 0d | 23 65 6e 64 69 66 0d 0d |= NULL;.|#endif..|
|00003c00| 09 09 09 09 5f 57 45 46 | 69 6c 6c 46 6f 6e 74 49 |...._WEF|illFontI|
|00003c10| 6e 66 6f 28 28 2a 68 57 | 45 29 2d 3e 70 6f 72 74 |nfo((*hW|E)->port|
|00003c20| 2c 20 26 69 6e 66 6f 29 | 3b 0d 0d 09 09 09 09 65 |, &info)|;......e|
|00003c30| 6c 65 6d 65 6e 74 2d 3e | 73 63 72 70 48 65 69 67 |lement->|scrpHeig|
|00003c40| 68 74 20 3d 20 69 6e 66 | 6f 2e 72 75 6e 48 65 69 |ht = inf|o.runHei|
|00003c50| 67 68 74 3b 0d 09 09 09 | 09 65 6c 65 6d 65 6e 74 |ght;....|.element|
|00003c60| 2d 3e 73 63 72 70 41 73 | 63 65 6e 74 20 3d 20 69 |->scrpAs|cent = i|
|00003c70| 6e 66 6f 2e 72 75 6e 41 | 73 63 65 6e 74 3b 0d 09 |nfo.runA|scent;..|
|00003c80| 09 09 7d 0d 0d 09 09 09 | 5f 57 45 53 65 74 48 61 |..}.....|_WESetHa|
|00003c90| 6e 64 6c 65 4c 6f 63 6b | 28 28 48 61 6e 64 6c 65 |ndleLock|((Handle|
|00003ca0| 29 68 53 74 79 6c 65 73 | 2c 20 68 53 74 79 6c 65 |)hStyles|, hStyle|
|00003cb0| 73 4c 6f 63 6b 65 64 29 | 3b 0d 09 09 7d 0d 23 65 |sLocked)|;...}.#e|
|00003cc0| 6e 64 69 66 20 2f 2f 20 | 57 41 53 54 45 5f 53 43 |ndif // |WASTE_SC|
|00003cd0| 41 4c 45 0d 09 7d 0d 0d | 09 69 66 20 28 65 72 72 |ALE..}..|.if (err|
|00003ce0| 29 0d 09 09 5f 57 45 46 | 6f 72 67 65 74 48 61 6e |)..._WEF|orgetHan|
|00003cf0| 64 6c 65 28 26 28 48 61 | 6e 64 6c 65 29 68 53 74 |dle(&(Ha|ndle)hSt|
|00003d00| 79 6c 65 73 29 3b 0d 0d | 09 72 65 74 75 72 6e 20 |yles);..|.return |
|00003d10| 68 53 74 79 6c 65 73 3b | 0d 7d 0d 0d 00 00 00 00 |hStyles;|.}......|
|00003d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d80| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00003d90| 24 01 2a 88 00 00 66 4c | 35 30 ff ff 24 01 34 6f |$.*...fL|50..$.4o|
|00003da0| 00 00 66 2c 12 48 ff ff | 24 01 3f 65 00 00 66 04 |..f,.H..|$.?e..f.|
|00003db0| 0a 57 45 53 63 72 61 70 | 73 2e 63 6e 74 65 72 73 |.WEScrap|s.cnters|
|00003dc0| 20 44 42 63 63 63 74 73 | 32 70 65 72 6f 6d 6c 6d | DBcccts|2peromlm|
|00003dd0| 02 00 54 45 58 54 43 57 | 49 45 01 00 ff ff ff ff |..TEXTCW|IE......|
|00003de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003df0| 00 00 ab 0f 89 97 00 00 | 30 4f 00 00 01 ac 07 f8 |........|0O......|
|00003e00| 00 00 30 e8 37 ee ff ff | 24 00 43 8c 00 00 3d dc |..0.7...|$.C...=.|
|00003e10| 62 a4 ff ff 24 00 4c 6f | 00 00 3d b4 41 c8 ff ff |b...$.Lo|..=.A...|
|00003e20| 24 00 55 52 00 00 3d 88 | 20 60 ff ff 24 00 5e 35 |$.UR..=.| `..$.^5|
|00003e30| 00 00 3d 60 23 96 ff ff | 24 00 67 18 00 00 3c 84 |..=`#...|$.g...<.|
|00003e40| 4b db ff ff 24 00 6f fb | 00 00 3d 64 76 53 ff ff |K...$.o.|..=dvS..|
|00003e50| 24 00 78 de 00 00 3f 30 | 49 76 ff ff 24 00 81 c1 |$.x...?0|Iv..$...|
|00003e60| 00 00 3f 14 3b 9c ff ff | 24 00 8a a4 00 00 3e f8 |..?.;...|$.....>.|
|00003e70| 7c 98 ff ff 24 00 93 87 | 00 00 3e dc 53 d5 ff ff ||...$...|..>.S...|
|00003e80| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00003e90| 07 9f d8 14 02 3a 00 00 | 00 1c 00 1e ff ff 00 00 |.....:..|........|
|00003ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+